-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
79 lines (61 loc) · 1.55 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
export WORKDIR = $(shell pwd)
project=services
cdk_src = cdk
service_src = services
tests_src = tests
e2e_tests = $(tests_src)/e2e
int_tests = $(tests_src)/integration
all_src = $(cdk_src) $(service_src) $(tests_src)
.PHONY: target
target:
@$(MAKE) pr
.PHONY: dev
dev:
pip install --upgrade pip pre-commit poetry
poetry install
pre-commit install
.PHONY: tests
tests:
poetry run pytest --ignore $(e2e_tests) --ignore $(int_tests) --cov=$(project) --cov-report=xml --cov-report term
.PHONY: tests/integration
tests/integration: tests deps
poetry run pytest $(int_tests) --cov=$(project) --cov-report=xml --cov-report term
.PHONY: tests/e2e
tests/e2e: tests deps
poetry run pytest $(e2e_tests) --cov=$(project) --cov-report=xml --cov-report term
.PHONY: format
format:
poetry run isort $(all_src)
poetry run black $(all_src)
.PHONY: lint
lint: format
poetry run flake8 $(all_src)
.PHONY: pre-commit
pre-commit:
pre-commit run --show-diff-on-failure
.PHONY: pr
pr: lint mypy pre-commit test
.PHONY: synth
synth: deps
poetry run cdk synth
.PHONY: deploy
deploy: deps
poetry run cdk deploy
.PHONY: deploy/diff
deploy/diff: deps
poetry run cdk diff
.PHONY: deploy/remove
deploy/remove:
poetry run cdk destroy
.PHONY: deploy/destroy
deploy/destroy:
poetry run cdk destroy
.PHONY: deps
deps:
scripts/make-deps.sh
.PHONY: clean
clean:
rm -rf cdk.out .vscode .pytest_cache .coverage coverage.xml .mypy_cache
find services -type f -name "requirements.txt" -delete
find services cdk tests -type d -name "__pycache__" -exec rm -rf {} \;
poetry env remove --all