-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmakefile
31 lines (22 loc) · 1.19 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
DIR=$(shell pwd)
ifndef STACK
$(error STACK is undefined)
endif
allcommitted:
bin/allcommitted
create:
aws cloudformation create-stack --stack-name $(STACK) --template-body file:///$(DIR)/cloudformation.yaml --parameters ParameterKey=GithubOAuthToken,ParameterValue=${GITHUB_TOKEN} --capabilities CAPABILITY_IAM
update:
aws cloudformation update-stack --stack-name $(STACK) --template-body file:///$(DIR)/cloudformation.yaml --parameters ParameterKey=GithubOAuthToken,ParameterValue=${GITHUB_TOKEN} --capabilities CAPABILITY_IAM
.build:
npm run build
changeset: allcommitted
$(eval COMMIT := $(shell git rev-parse HEAD))
aws cloudformation create-change-set --stack-name $(STACK) --template-body file:///$(DIR)/cloudformation.yaml --parameters ParameterKey=GithubOAuthToken,ParameterValue=${GITHUB_TOKEN} --capabilities CAPABILITY_IAM --change-set-name $(COMMIT)
upload: .build
$(eval BUCKET := $(shell aws cloudformation describe-stacks --stack-name $(STACK) --query "Stacks[].Outputs[?OutputKey=='BucketName'][].OutputValue" --output text))
aws s3 sync build/ s3://$(BUCKET)
info:
aws cloudformation describe-stacks --stack-name $(STACK) --query "Stacks[].Outputs" --output text
hi:
echo ${STACK}