-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (30 loc) · 1.17 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
.PHONY: build clean deploy
ENVIRONMENT ?= prod
PROJECT = "aws rekognition power to axis"
OWNER = "innovation"
STACK_NAME = axis-aws-rekognition
ARTIFACTS_BUCKET = s3-bucket-to-upload-the-lambda-artifact-for-deploy
AWS_DEFAULT_REGION ?= eu-west-1
AWS_PROFILE ?= your-aws-cli-profile
sam_package = aws --profile $(AWS_PROFILE) cloudformation package \
--template-file template.yml \
--output-template-file template_out.yaml \
--s3-bucket $(ARTIFACTS_BUCKET)
sam_deploy = aws --profile $(AWS_PROFILE) cloudformation deploy \
--template-file template_out.yaml \
--stack-name $(STACK_NAME) \
--region $(AWS_DEFAULT_REGION) \
--capabilities CAPABILITY_IAM \
--parameter-overrides \
$(shell cat parameters.conf) \
--tags Project=$(PROJECT) Owner=$(OWNER) \
--no-fail-on-empty-changeset
build:
cd src/; GOOS=linux go build -ldflags="-s -w" -o main && zip deployment.zip main
clean:
@rm -rf src/deployment.zip template_out.yaml
deploy:
make build
$(call sam_package)
$(call sam_deploy)
make clean