~tribaal/charms/trusty/landscape-charm/1587290-aptitude-install

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
PYTHON := /usr/bin/env python

test:
	trial lib

ci-test:
	./dev/ubuntu-deps
	$(MAKE) test lint

verify-juju-test:
	@echo "Checking for ... "
	@echo -n "juju-test: "
	@if [ -z `which juju-test` ]; then \
		echo -e "\nRun ./dev/ubuntu-deps to get the juju-test command installed"; \
		exit 1;\
	else \
		echo "installed"; \
	fi

update-charm-revision-numbers: bundles
	@dev/update-charm-revision-numbers \
		$(EXTRA_UPDATE_ARGUMENTS) \
		apache2 postgresql juju-gui haproxy rabbitmq-server nfs

test-depends: verify-juju-test bundles
	@cd tests && python3 test_helpers.py

bundles:
	@if [ -d bundles ]; then \
	    bzr up bundles; \
	else \
	    bzr co lp:~landscape/landscape-charm/bundles-trunk bundles; \
	fi

secrets:
	@if [ -d secrets ]; then \
	    bzr up secrets; \
	else \
	    bzr co lp:~landscape/landscape/secrets secrets; \
	fi

integration-test: test-depends
	juju test --set-e -p LS_CHARM_SOURCE,JUJU_HOME,JUJU_ENV,PG_MANUAL_TUNING -v --timeout 3000s

# Run integration tests using the LDS package from the lds-trunk PPA
integration-test-trunk: secrets
	LS_CHARM_SOURCE=lds-trunk-ppa $(MAKE) $(subst -trunk,,$@)

deploy-dense-maas: bundles
	./dev/deployer dense-maas

deploy-dense-maas-dev: bundles
	./dev/deployer dense-maas --flags juju-debug

deploy: bundles
	./dev/deployer scalable

repo-file-trunk: secrets
	grep -e "^source:" secrets/lds-trunk-ppa | cut -f 2- -d " " > config/repo-file

lint:
	flake8 --filename='*' hooks
	flake8 lib tests
	pyflakes3 tests dev/update-charm-revision-numbers
	find . -name *.py -not -path "./old/*" -not -path "*/charmhelpers/*" -print0 | xargs -0 flake8
	flake8 tests dev/update-charm-revision-numbers

clean:
	@rm -rf bundles
	@find -name '*.pyc' -delete

.PHONY: lint \
	test-depends \
	deploy-dense-maas \
	deploy-dense-maas-dev \
	integration-test \
	verify-juju-test \
	test \
	clean \
	update-charm-revision-numbers \
	bundles \
	deploy

dev/charm_helpers_sync.py:
	@mkdir -p dev
	@bzr cat lp:charm-helpers/tools/charm_helpers_sync/charm_helpers_sync.py \
            > dev/charm_helpers_sync.py

sync: dev/charm_helpers_sync.py
	$(PYTHON) dev/charm_helpers_sync.py -c charm-helpers.yaml

build: secrets test-depends

.DEFAULT_GOAL := build