-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
44 lines (37 loc) · 1.7 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
ENVIRONMENT ?= prod
PROJECT = itops
STACK_NAME = concierge
ARTIFACTS_BUCKET = deeplens-sagemaker-lezgin
AWS_DEFAULT_REGION ?= us-east-1
sam_package = aws cloudformation package \
--template-file sam.yaml \
--output-template-file dist/sam.yaml \
--s3-bucket $(ARTIFACTS_BUCKET)
sam_deploy = aws cloudformation deploy \
--template-file dist/sam.yaml \
--stack-name $(STACK_NAME) \
--region $(AWS_DEFAULT_REGION) \
--parameter-overrides \
$(shell cat parameters.conf) \
--capabilities CAPABILITY_IAM \
--no-fail-on-empty-changeset
deploy:
@mkdir -p dist
# golang
cd source/guess; GOOS=linux go build -ldflags="-s -w" -o main && zip deployment.zip main
cd source/unknown; GOOS=linux go build -ldflags="-s -w" -o main && zip deployment.zip main
cd source/train; GOOS=linux go build -ldflags="-s -w" -o main && zip deployment.zip main
cd source/alexa-skill-concierge-open-door; go get github.com/ericdaugherty/alexa-skills-kit-golang; GOOS=linux go build -ldflags="-s -w" -o main && zip deployment.zip main
# python
cd source/find-person; mkdir dist \
&& cp find_person.py dist/ \
&& cd dist; zip deployment.zip *
docker run -v ${PWD}/source/trigger-open:/app -w /app -it python:2.7-alpine sh -c "pip install -r requirements.txt -t ./dist; chmod -R 777 dist"
cd source/trigger-open && cp trigger_open.py dist/ \
&& cd dist/ && zip -r deployment.zip *
# sam
$(call sam_package)
$(call sam_deploy)
@rm -rf source/*/main source/*/deployment.zip source/*/dist dist
clean:
@rm -rf source/*/main source/*/deployment.zip source/*/dist dist