-
Notifications
You must be signed in to change notification settings - Fork 5
/
makefile
64 lines (49 loc) · 2.31 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
include ./config.mk
TODOMVC_FRONTEND_URL = $(shell aws cloudformation describe-stacks --stack-name xilution-todomvc-base | jq '.Stacks[0].Outputs[1].OutputValue')
TODOMVC_BACKEND_URL = $(shell aws cloudformation describe-stacks --stack-name xilution-todomvc-sam | jq '.Stacks[0].Outputs[0].OutputValue')
build-frontend:
TODOMVC_BACKEND_URL=$(TODOMVC_BACKEND_URL) yarn build:frontend
build-backend:
yarn build:backend
make package-sam
@echo "^Do not use that last suggested command!^ Execute the following command instead:"
@echo "make deploy-backend"
deploy-frontend:
aws s3 cp ./dist/frontend/ s3://$(AWS_WEBSITE_BUCKET)/ --recursive --include "*" --acl public-read
deploy-backend:
aws cloudformation deploy --stack-name xilution-todomvc-sam \
--template-file ./dist/template-sam.yaml \
--parameter-overrides XilutionClientId=$(XILUTION_CLIENT_ID)
deprovision-base:
aws cloudformation delete-stack --stack-name xilution-todomvc-base
deprovision-backend:
aws cloudformation delete-stack --stack-name xilution-todomvc-sam
dev:
TODOMVC_BACKEND_URL=$(TODOMVC_BACKEND_URL) yarn dev
package-sam:
aws cloudformation package \
--template-file ./aws/cloud-formation/template-sam.yml \
--s3-bucket $(AWS_STAGING_BUCKET) \
--output-template-file ./dist/template-sam.yaml
put-types:
mkdir -p ./temp
npx babel ./src/backend/* --out-dir ./temp/src/backend
XilutionClientId=$(XILUTION_CLIENT_ID) node ./utils/types/put-types.js
provision-base:
aws cloudformation create-stack --stack-name xilution-todomvc-base \
--template-body file://./aws/cloud-formation/template-base.yml \
--parameters ParameterKey=StagingBucketName,ParameterValue=$(AWS_STAGING_BUCKET) \
ParameterKey=WebsiteBucketName,ParameterValue=$(AWS_WEBSITE_BUCKET) \
--capabilities CAPABILITY_NAMED_IAM
reprovision-base:
aws cloudformation update-stack --stack-name xilution-todomvc-base \
--template-body file://./aws/cloud-formation/template-base.yml \
--parameters ParameterKey=StagingBucketName,ParameterValue=$(AWS_STAGING_BUCKET) \
ParameterKey=WebsiteBucketName,ParameterValue=$(AWS_WEBSITE_BUCKET) \
--capabilities CAPABILITY_NAMED_IAM
show-frontend-url:
@echo $(TODOMVC_FRONTEND_URL)
show-backend-url:
@echo $(TODOMVC_BACKEND_URL)
show-frontend-ssl-url:
@echo https://s3.$(AWS_REGION).amazonaws.com/$(AWS_WEBSITE_BUCKET)/index.html