-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (43 loc) · 1.88 KB
/
Copy pathMakefile
File metadata and controls
51 lines (43 loc) · 1.88 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
44
45
46
47
48
49
50
51
export DJANGO_SETTINGS_MODULE?=wcivf.settings.lambda
export DC_ENVIRONMENT?=development
export AWS_DEFAULT_REGION?=eu-west-2
.PHONY: all
make all: build clean
.PHONY: build
build:
sam build -t ./sam-template.yaml
.PHONY: clean
clean: ## Delete any unneeded static asset files and git-restore the rendered API documentation file
rm -rf .aws-sam/build/WCIVFControllerFunction/wcivf/static/booklets/
rm -rf .aws-sam/build/WCIVFControllerFunction/wcivf/assets/booklets/
rm -rf .aws-sam/build/WCIVFControllerFunction/wcivf/assets/images/
rm -rf .aws-sam/build/WCIVFControllerFunction/wcivf/static/images/
rm -rf .aws-sam/build/WCIVFControllerFunction/wcivf/media/
rm -rf .aws-sam/build/WCIVFControllerFunction/docs/
rm -f .aws-sam/build/WCIVFControllerFunction/wcivf/settings/local.py
rm -f .aws-sam/build/WCIVFControllerFunction/results_app.dot
rm -f .aws-sam/build/WCIVFControllerFunction/results_app.png
rm -f .aws-sam/build/WCIVFControllerFunction/transifex.yml
rm -f .aws-sam/build/WCIVFControllerFunction/local.example
.PHONY: lambda-migrate
lambda-migrate: ## Invoke lambda to migrate the database
output=$$(aws lambda invoke \
--function-name WCIVFControllerFunction \
--payload '{ "command": "migrate", "args": ["--no-input"] }' \
--cli-binary-format raw-in-base64-out \
--output json \
/dev/stdout); \
echo "$$output"; \
echo "$$output" | grep -q '"FunctionError"' && exit 1 || exit 0
.PHONY: makemessages
makemessages:
${VIRTUAL_ENV}/bin/python manage.py makemessages -l cy --ignore='.venv*'
.PHONY: compilemessages
compilemessages:
${VIRTUAL_ENV}/bin/python manage.py compilemessages --ignore='.venv*'
build-WCIVFControllerFunction:
uv venv
uv export --no-hashes --no-dev --group deploy > "$(ARTIFACTS_DIR)/requirements.txt"
uv pip install --upgrade -r "$(ARTIFACTS_DIR)/requirements.txt" --target "$(ARTIFACTS_DIR)"
cp -r wcivf $(ARTIFACTS_DIR)
cp manage.py $(ARTIFACTS_DIR)