-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
31 lines (23 loc) · 1.5 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
.DEFAULT_GOAL := help
export SECRET_KEY?=badf00d
export DJANGO_SETTINGS_MODULE?=electionleaflets.settings
export APP_IS_BEHIND_CLOUDFRONT?=False
.PHONY: all
all: clean collectstatic lambda-layers/DependenciesLayer/requirements.txt thumbs/requirements.txt ## 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 electionleaflets/static_files/ lambda-layers/DependenciesLayer/requirements.txt
rm -rf thumbs/requirements.txt
.PHONY: collectstatic
collectstatic: ## Rebuild the static assets
python manage.py collectstatic --noinput --clear
lambda-layers/DependenciesLayer:
mkdir -p $@
lambda-layers/DependenciesLayer/requirements.txt: Pipfile Pipfile.lock lambda-layers/DependenciesLayer lambda-layers/DependenciesLayer ## Update the requirements.txt file used to build this Lambda function's DependenciesLayer
pipenv requirements | sed "s/^-e //" >lambda-layers/DependenciesLayer/requirements.txt
thumbs/requirements.txt: thumbs/Pipfile thumbs/Pipfile.lock ## Update the requirements.txt file used to build this Lambda function's DependenciesLayer
cd thumbs && pipenv requirements | sed "s/^-e //" >requirements.txt
.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}'