-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (32 loc) · 942 Bytes
/
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
STACK_NAME := stack-unzipper-lambda
TEMPLATE_FILE := template.yaml
PACKAGED_FILE := packaged.yaml
build:
go mod vendor
go mod tidy
go mod verify
GOARCH=amd64 GOOS=linux go build -o artifact/unzipper ./src/
.PHONY: build
deploy: build
sam package \
--template-file ${TEMPLATE_FILE} \
--s3-bucket ${STACK_BUCKET} \
--output-template-file ${PACKAGED_FILE}
sam deploy \
--template-file ${PACKAGED_FILE} \
--stack-name ${STACK_NAME} \
--capabilities CAPABILITY_IAM \
--parameter-overrides \
ZippedArtifactBucket=${ZIPPED_ARTIFACT_BUCKET} \
UnzippedArtifactBucket=${UNZIPPED_ARTIFACT_BUCKET}
.PHONY: deploy
delete:
aws s3 rm "s3://$(ZIPPED_ARTIFACT_BUCKET)" --recursive
aws s3 rm "s3://$(UNZIPPED_ARTIFACT_BUCKET)" --recursive
aws cloudformation delete-stack --stack-name $(STACK_NAME)
aws s3 rm "s3://$(STACK_BUCKET)" --recursive
aws s3 rb "s3://$(STACK_BUCKET)"
.PHONY: delete
test:
go test ./...
.PHONY: test