~verterok/landscape-charm/support-postgresql-charm-v2-protocol

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
95
96
97
98
99
PYTHON := /usr/bin/env python

test:
	trial lib
	# For now only the install hook runs against python3
	trial3 lib/tests/test_apt.py lib/tests/test_install.py

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

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

test-depends: bundles
	pip install --user bundletester juju-deployer
	pip3 install --user amulet
	cd tests && python3 test_helpers.py

bundles-checkout:
	@if [ -d bundles ]; then \
	    bzr up bundles; \
	else \
	    bzr co lp:landscape-bundles bundles; \
	fi; \
	make -C bundles deps
	make -C bundles clean

bundles: bundles-checkout
	bundles/render-bundles

bundles-local-branch: bundles-checkout
	bundles/render-bundles --landscape-branch $(CURDIR)

bundles-local-charm: bundles-checkout
	bundles/render-bundles --landscape-charm $(CURDIR)

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

integration-test: test-depends
	~/.local/bin/bundletester -v -l DEBUG --skip-implicit -t .

# 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-local-branch
	./dev/deployer dense-maas

deploy-dense-maas-dev: bundles-local-branch repo-file-trunk
	./dev/deployer dense-maas --flags juju-debug

deploy: bundles-local-branch
	./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 "./build/*" -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