2
SOURCEDEPS_DIR ?= $(shell dirname $(PWD))/.sourcecode
3
HOOKS_DIR := $(PWD)/hooks
4
TEST_PREFIX := PYTHONPATH=$(HOOKS_DIR)
5
TEST_DIR := $(PWD)/hooks/tests
6
SITE_TEST_DIR := $(PWD)/files/webroot
7
SITE_TEST_OPTIONS := --console
9
PYTHON := /usr/bin/env python
10
CONFIGMANAGER := $(PWD)/bin/cm.py
13
# removed 'test', 'lint', 'proof'
14
build: revision sourcedeps
17
@test -f revision || echo 0 > revision
20
# @echo Proofing charm...
21
# @(charm proof $(PWD) || [ $$? -eq 100 ]) && echo OK
22
# @test `cat revision` = 0 && rm revision
25
@echo Starting tests...
26
# @CHARM_DIR=$(CHARM_DIR) $(TEST_PREFIX) nosetests $(TEST_DIR)
27
grover $(SITE_TEST_OPTIONS) $(SITE_TEST_DIR)/test*.html -o webui_tests.json --json
30
# @echo Checking for Python syntax...
31
# flake8 $(HOOKS_DIR) --ignore=E123 --exclude=$(HOOKS_DIR)/charmhelpers && echo OK
33
sourcedeps: $(PWD)/config-manager.txt
34
@echo Updating source dependencies...
35
@$(PYTHON) cm.py -c $(PWD)/config-manager.txt \
36
-p $(SOURCEDEPS_DIR) \
38
@$(PYTHON) build/charm-helpers/tools/charm_helpers_sync/charm_helpers_sync.py \
39
-c charm-helpers.yaml \
40
-b build/charm-helpers \
42
@echo Do not forget to commit the updated files if any.
43
#@cd $(PWD)/build/charm-helpers; \
44
#@$(PYTHON) setup.py install --install-purelib=$(PWD)/lib \
45
#--install-scripts=$(PWD)/lib/bin
48
rm -fr hooks/charmhelpers build/charm-helpers
50
destroy: undeploy undeploy_apache
53
juju deploy --config apache_config.yaml --repository=$(HOME)/bzr/canonical-is-charms local:apache2
56
juju destroy-service apache2
59
juju remove-relation apache2 webui || echo "relation doesn't exist"
60
juju destroy-service webui || echo "service webui doesn't exist"
62
deploy_only: build test
64
juju deploy -u --repository=$(PWD)/../../ local:webui
66
deploy: deploy_only add_relation
68
deploy_all: deploy_apache deploy
71
juju add-relation apache2 webui
73
reset: undeploy status deploy status
75
redeploy: undeploy status deploy status
84
juju upgrade-charm --repository=$(PWD)/../../ webui
87
# removed 'test', 'lint', 'proof'
88
.PHONY: revision sourcedeps charm-payload reset status deploy_only deploy build