This repository has been archived by the owner on Apr 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
28 lines (23 loc) · 1.73 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
.requirements.txt: Pipfile Pipfile.lock
pipenv lock -r > .requirements.txt
.requirements: .requirements.txt
rm -rf .requirements
mkdir .requirements
pip install -r .requirements.txt --no-deps -t .requirements
package.zip: .requirements api/*.py
rm -f package.zip
(cd .requirements ; zip ../package.zip -r *)
(cd api ; zip ../package.zip -r *.py)
.PHONY: deploy_api deploy_site
deploy_api: package.zip
aws s3 cp package.zip s3://theyhelpyou/package-$(word 1,$(shell md5sum package.zip)).zip
aws lambda update-function-code --region eu-west-2 --function-name theyhelpyou_fetch_by_postcode --s3-bucket theyhelpyou --s3-key package-$(word 1,$(shell md5sum package.zip)).zip --publish
aws lambda update-function-code --region eu-west-2 --function-name theyhelpyou_import_sheet --s3-bucket theyhelpyou --s3-key package-$(word 1,$(shell md5sum package.zip)).zip --publish
aws lambda update-function-code --region eu-west-2 --function-name theyhelpyou_report_a_problem --s3-bucket theyhelpyou --s3-key package-$(word 1,$(shell md5sum package.zip)).zip --publish
aws lambda update-function-code --region eu-west-2 --function-name theyhelpyou_export_for_llm --s3-bucket theyhelpyou --s3-key package-$(word 1,$(shell md5sum package.zip)).zip --publish
aws lambda update-function-code --region eu-west-2 --function-name theyhelpyou_update_attr --s3-bucket theyhelpyou --s3-key package-$(word 1,$(shell md5sum package.zip)).zip --publish
aws lambda update-function-code --region eu-west-2 --function-name theyhelpyou_import_from_llm --s3-bucket theyhelpyou --s3-key package-$(word 1,$(shell md5sum package.zip)).zip --publish
deploy_site: site/index.html
aws s3 sync site s3://theyhelpyou/ --acl public-read --cache-control max-age=300
test:
pipenv run pytest api