~maxiberta/canonical-identity-provider/charm-add-openid-session-limit

« back to all changes in this revision

Viewing changes to charm.mk

  • Committer: Simon Davy
  • Date: 2015-10-01 13:52:11 UTC
  • mto: This revision was merged to the branch mainline in revision 60.
  • Revision ID: simon.davy@canonical.com-20151001135211-4l95mfhdgt4ezg49
enable dev with charm

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
CHARM ?= $(shell grep name: metadata.yaml | awk '{print $$2}')
39
39
CHARM_SERIES ?= trusty
40
 
# python one-liner to grab the name of the service for this charm
41
 
# I am sorry.
42
 
GET_SVC = "import yaml; e = yaml.load(open('$(DEPLOYER_CONFIG)')).values()[0]['services']; print filter(lambda x: '$(CHARM)' in x[1]['charm'], e.items())[0][0]"
43
 
SERVICE = $(shell python -c $(GET_SVC))
 
40
 
 
41
# workarond for lack of multiline vars
 
42
define NEWLINE
 
43
 
 
44
 
 
45
endef
 
46
 
 
47
define GET_SVC
 
48
import yaml
 
49
e = yaml.load(open('$(DEPLOYER_CONFIG)'))
 
50
for env in e.values():
 
51
    for name, svc in env['services'].items():
 
52
        if '$(CHARM)' in svc['charm']:
 
53
            print name
 
54
 
 
55
endef
 
56
 
 
57
SERVICE = $(shell echo "$(subst $(NEWLINE),@NEWLINE@,${GET_SVC})" | sed 's/@NEWLINE@/\n/g' | python -)
44
58
UNIT = $(SERVICE)/0
45
59
CHARM_UNIT_PATH ?= /var/lib/juju/agents/unit-$(SERVICE)-0/charm
46
60
 
162
176
 
163
177
# deploy the env from scratch
164
178
deploy: payload | $(JUJU_REPOSITORY) exec.d/basenode
165
 
        juju-deployer -d --local-mods -c $(DEPLOYER_CONFIG)
 
179
        juju-deployer -d --local-mods -c $(DEPLOYER_CONFIG) sso
166
180
        $(MAKE) setup-environment  # HOOK into your Makefile
167
181
        $(MAKE) rollout SKIP_BUILD=true
168
182