-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
110 lines (93 loc) · 3.14 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
SHELL := $(shell which bash)
.PHONEY:
clean
deploy
deploy-integration
destroy
destroy-integration
diff
diff-integration
format
install
integration-tests
lint
unit-tests
clean:
pipenv --rm || true
$(MAKE) -C layers/db clean
$(MAKE) -C lambdas/link_fetcher clean
$(MAKE) -C lambdas/date_generator clean
$(MAKE) -C lambdas/downloader clean
$(MAKE) -C lambdas/mock_scihub_search_api clean
$(MAKE) -C lambdas/mock_scihub_product_api clean
$(MAKE) -C lambdas/requeuer clean
$(MAKE) -C alembic_migration clean
install:
pipenv install --dev
$(MAKE) -C alembic_migration install
$(MAKE) -C lambdas/date_generator install
$(MAKE) -C lambdas/link_fetcher install
$(MAKE) -C lambdas/downloader install
$(MAKE) -C lambdas/mock_scihub_product_api install
$(MAKE) -C lambdas/mock_scihub_search_api install
$(MAKE) -C lambdas/requeuer install
$(MAKE) -C layers/db install
lint:
pipenv run ruff format --diff cdk/ integration_tests/
pipenv run ruff check cdk/ integration_tests/
$(MAKE) -C lambdas/link_fetcher lint
$(MAKE) -C lambdas/date_generator lint
$(MAKE) -C lambdas/downloader lint
$(MAKE) -C lambdas/mock_scihub_search_api lint
$(MAKE) -C lambdas/mock_scihub_product_api lint
$(MAKE) -C lambdas/requeuer lint
$(MAKE) -C layers/db lint
$(MAKE) -C alembic_migration lint
format:
pipenv run ruff format cdk/ integration_tests/
$(MAKE) -C lambdas/link_fetcher format
$(MAKE) -C lambdas/date_generator format
$(MAKE) -C lambdas/downloader format
$(MAKE) -C lambdas/mock_scihub_search_api format
$(MAKE) -C lambdas/mock_scihub_product_api format
$(MAKE) -C lambdas/requeuer format
$(MAKE) -C layers/db format
$(MAKE) -C alembic_migration format
diff:
tox -e dev -- diff --app cdk/app.py || true
deploy:
tox -e dev -- deploy --app cdk/app.py --require-approval never
destroy:
tox -e dev -- destroy --app cdk/app.py --force
diff-integration:
tox -e dev -- diff '*' --app cdk/app_integration.py || true
deploy-integration:
tox -e dev -- deploy '*' --app cdk/app_integration.py --require-approval never
destroy-integration:
tox -e dev -- destroy '*' --app cdk/app_integration.py --force
unit-tests:
$(MAKE) -C lambdas/link_fetcher test
$(MAKE) -C lambdas/date_generator test
$(MAKE) -C lambdas/downloader test
$(MAKE) -C lambdas/mock_scihub_search_api test
$(MAKE) -C lambdas/mock_scihub_product_api test
$(MAKE) -C lambdas/requeuer test
$(MAKE) -C layers/db test
$(MAKE) -C alembic_migration test
integration-tests:
tox -e integration
#-------------------------------------------------------------------------------
# For invocation via tox only (i.e., in tox.ini commands entries)
#-------------------------------------------------------------------------------
tox:
@if [[ -z $${TOX_ENV_DIR+x} ]]; then echo "ERROR: For tox.ini use only" >&2; exit 1; fi
# Install node in the virtualenv, if it's not installed.
install-node: tox
if [[ ! $$(type node 2>/dev/null) =~ $${VIRTUAL_ENV} ]]; then \
nodeenv --node lts --python-virtualenv; \
fi
# Install cdk in the virtualenv, if it's not installed.
install-cdk: install-node
if [[ ! $$(type cdk 2>/dev/null) =~ $${VIRTUAL_ENV} ]]; then \
npm install --location global "aws-cdk@latest"; \
fi