-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (32 loc) · 2.23 KB
/
Copy pathMakefile
File metadata and controls
43 lines (32 loc) · 2.23 KB
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
.DEFAULT_GOAL := help
export SECRET_KEY?=badf00d
export DJANGO_SETTINGS_MODULE?=frontend.settings.base_lambda
export APP_IS_BEHIND_CLOUDFRONT?=False
REQUIREMENTS = "lambda-layers/FrontendDependenciesLayer/requirements.txt"
.PHONY: all
all: clean collectstatic lambda-layers/FrontendDependenciesLayer/requirements.txt lambda-layers/PolarsLayer/requirements.txt aggregator/apps/api_docs/v1/templates/api_docs_rendered.html ## Rebuild everything this Makefile knows how to build
.PHONY: clean
clean: ## Delete any generated static asset or req.txt files and git-restore the rendered API documentation file
rm -rf api/frontend/frontend/static_files/ lambda-layers/FrontendDependenciesLayer/requirements.txt lambda-layers/PolarsLayer/requirements.txt
git checkout api/frontend/frontend/apps/api_docs/v1/templates/api_docs_rendered.html
.PHONY: collectstatic
collectstatic: ## Rebuild the static assets
python manage.py collectstatic --noinput --clear
.PHONY: check_empty
check_empty: ## Check if the requirements.txt file is empty
if [ ! -s "${REQUIREMENTS}" ]; then
echo "File is empty"
else
echo "File is not empty"
fi
lambda-layers/FrontendDependenciesLayer/requirements.txt: api/frontend/pyproject.toml uv.lock ## Update the requirements.txt file used to build this Lambda function's FrontendDependenciesLayer
uv export --no-dev --no-hashes --no-editable --no-emit-workspace --package frontend > lambda-layers/FrontendDependenciesLayer/requirements.txt
lambda-layers/PolarsLayer/requirements.txt: api/endpoints/pyproject.toml uv.lock ## Update the requirements.txt file used to build this Lambda function's PolarsLayer
uv export --no-dev --no-hashes --no-editable --no-emit-workspace --package endpoints --only-group polars > lambda-layers/PolarsLayer/requirements.txt
.PHONY: aggregator/apps/api_docs/v1/templates/api_docs_rendered.html
aggregator/apps/api_docs/v1/templates/api_docs_rendered.html: ## Rebuild the API documentation page
PIPELINE_ENABLED=True python manage.py build_docs
.PHONY: help
# gratuitously adapted from https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help: ## Display this help text
@grep -E '^[-a-zA-Z0-9_/.]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%s\033[0m\n\t%s\n", $$1, $$2}'