~nuclearbob/uci-engine/removed-bootspeed-zeroes

« back to all changes in this revision

Viewing changes to charms/precise/webui/Makefile

  • Committer: Joe Talbott
  • Date: 2014-01-23 17:11:17 UTC
  • mto: (126.2.10 webui)
  • mto: This revision was merged to the branch mainline in revision 161.
  • Revision ID: joe.talbott@canonical.com-20140123171117-82s9buwmb4lazj6f
Add webui charm.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
PWD := $(shell pwd)
 
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
 
8
CHARM_DIR := $(PWD)
 
9
PYTHON := /usr/bin/env python
 
10
CONFIGMANAGER := $(PWD)/bin/cm.py
 
11
 
 
12
 
 
13
# removed 'test', 'lint', 'proof'
 
14
build: revision sourcedeps
 
15
 
 
16
revision:
 
17
        @test -f revision || echo 0 > revision
 
18
 
 
19
#proof: revision
 
20
#       @echo Proofing charm...
 
21
#       @(charm proof $(PWD) || [ $$? -eq 100 ]) && echo OK
 
22
#       @test `cat revision` = 0 && rm revision
 
23
 
 
24
test:
 
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
 
28
 
 
29
#lint:
 
30
#       @echo Checking for Python syntax...
 
31
#       flake8 $(HOOKS_DIR) --ignore=E123 --exclude=$(HOOKS_DIR)/charmhelpers && echo OK
 
32
 
 
33
sourcedeps: $(PWD)/config-manager.txt
 
34
        @echo Updating source dependencies...
 
35
        @$(PYTHON) cm.py -c $(PWD)/config-manager.txt \
 
36
                -p $(SOURCEDEPS_DIR) \
 
37
                -t $(PWD)
 
38
        @$(PYTHON) build/charm-helpers/tools/charm_helpers_sync/charm_helpers_sync.py \
 
39
                -c charm-helpers.yaml \
 
40
                -b build/charm-helpers \
 
41
                -d hooks/charmhelpers
 
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
 
46
 
 
47
clean:
 
48
        rm -fr hooks/charmhelpers build/charm-helpers
 
49
 
 
50
destroy: undeploy undeploy_apache
 
51
 
 
52
deploy_apache:
 
53
        juju deploy --config apache_config.yaml --repository=$(HOME)/bzr/canonical-is-charms local:apache2 
 
54
 
 
55
undeploy_apache:
 
56
        juju destroy-service apache2
 
57
 
 
58
undeploy: 
 
59
        juju remove-relation apache2 webui || echo "relation doesn't exist"
 
60
        juju destroy-service webui || echo "service webui doesn't exist"
 
61
 
 
62
deploy_only: build test
 
63
        ls -al $(PWD)/../../
 
64
        juju deploy -u --repository=$(PWD)/../../ local:webui
 
65
 
 
66
deploy: deploy_only add_relation
 
67
 
 
68
deploy_all: deploy_apache deploy
 
69
 
 
70
add_relation:
 
71
        juju add-relation apache2 webui
 
72
 
 
73
reset: undeploy status deploy status
 
74
 
 
75
redeploy: undeploy status deploy status
 
76
 
 
77
connect:
 
78
        juju ssh apache2/0
 
79
 
 
80
status:
 
81
        juju status
 
82
 
 
83
upgrade: test
 
84
        juju upgrade-charm --repository=$(PWD)/../../ webui
 
85
 
 
86
 
 
87
# removed 'test', 'lint', 'proof'
 
88
.PHONY: revision sourcedeps charm-payload reset status deploy_only deploy build