-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
30 lines (24 loc) · 846 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
TEMPLATE_FILE=template.yml
OUTPUT_FILE=sam.yml
FUNCTIONS=build/main
build/helper: helper/*.go
go build -o build/helper ./helper/
build/main: ./*.go
env GOARCH=amd64 GOOS=linux go build -o build/main .
clean:
rm $(FUNCTIONS)
test:
go test -v ./lib/
sam.yml: $(TEMPLATE_FILE) $(FUNCTIONS) build/helper
aws cloudformation package \
--region $(shell ./build/helper get Region) \
--template-file $(TEMPLATE_FILE) \
--s3-bucket $(shell ./build/helper get CodeS3Bucket) \
--s3-prefix $(shell ./build/helper get CodeS3Prefix) \
--output-template-file $(OUTPUT_FILE)
deploy: $(OUTPUT_FILE) build/helper
aws cloudformation deploy \
--region $(shell ./build/helper get Region) \
--template-file $(OUTPUT_FILE) \
--stack-name $(shell ./build/helper get StackName) \
--capabilities CAPABILITY_IAM $(shell ./build/helper mkparam)