-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
96 lines (79 loc) · 2.26 KB
/
Makefile
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
SHELL=/usr/bin/env bash
TOX=tox $(TOX_OPTS)
TOX_OPTS?=-v
.DEFAULT_GOAL := help
.PHONY: \
help \
install-cdk \
install-node \
integration-tests \
tox \
unit-tests \
synth \
diff \
deploy \
destroy \
synth-it \
diff-it \
deploy-it \
destroy-it
help: Makefile
@echo
@echo "Usage: make [options] target ..."
@echo
@echo "Options:"
@echo " Run 'make -h' to list options."
@echo
@echo "Targets:"
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo
tox:
@if [[ -z $${TOX_ENV_DIR} ]]; then \
echo "ERROR: For tox.ini use only" >&2; \
exit 1; \
fi
# NOTE: Intended only for use from tox.ini.
# Install Node.js within the tox virtualenv, if it's not installed or it's the wrong version.
install-node: tox
@if [[ ! $$(type node 2>/dev/null) =~ $${VIRTUAL_ENV} ]]; then \
set -x; nodeenv --node lts --python-virtualenv; \
fi
# NOTE: Intended only for use from tox.ini
# Install the CDK CLI within the tox virtualenv, if it's not installed or it's the wrong version.
install-cdk: tox install-node
@if [[ ! $$(type cdk 2>/dev/null) =~ $${VIRTUAL_ENV} ]]; then \
set -x; npm install --location global "aws-cdk@latest"; \
fi
## venv: Create Python virtual environment in directory `venv`
venv: setup.py
$(TOX) devenv
## unit-tests: Run unit tests
unit-tests:
$(TOX)
## integration-tests: Run integration tests (must run deploy-it first)
integration-tests:
$(TOX) -e integration
## synth: Run CDK synth
synth:
$(TOX) -e dev -- synth
## diff: Run CDK diff
diff:
$(TOX) -e dev -- diff
## deploy: Run CDK deploy
deploy:
$(TOX) -e dev -- deploy --progress events --require-approval never
## destroy: Run CDK destroy
destroy:
$(TOX) -e dev -- destroy --progress events --force
## synth-it: Run CDK synth for integration stack
synth-it:
$(TOX) -e dev -- synth --app "python app_it.py" --all
## diff-it: Run CDK diff for integration stack
diff-it:
$(TOX) -e dev -- diff --app "python app_it.py" --all
## deploy-it: Run CDK deploy for integration stack
deploy-it:
$(TOX) -e dev -- deploy --app "python app_it.py" --all --progress events --require-approval never --outputs-file cdk.out/outputs.json
## destroy-it: Run CDK destroy for integration stack
destroy-it:
$(TOX) -e dev -- destroy --app "python app_it.py" --all --progress events --force