-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (29 loc) · 970 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
37
38
39
#!make
.PHONY: compile validate build package deploy down
BUCKET = sam-stereotype
BUCKET_PREFIX = stereotype-files
STACK = sam-stereotype-stack
# EXECUTABLES are expected in your path - install if not present
EXECUTABLES = npm aws sam
K := $(foreach exec,$(EXECUTABLES),\
$(if $(shell which $(exec)),some string,$(error "No $(exec) in PATH)))
compile:
./node_modules/.bin/webpack
echo ./dist/* | xargs -n 1 cp ./src/package.json
validate:
sam validate
build:
sam build
package: build
sam package --template-file .aws-sam/build/template.yaml \
--s3-bucket=$(BUCKET) \
--s3-prefix=$(BUCKET_PREFIX) \
--output-template-file deployment.yaml
deploy:
sam deploy --template-file deployment.yaml \
--stack-name $(STACK) \
--capabilities CAPABILITY_IAM || aws cloudformation describe-stack-events --stack-name $(STACK) --output table | grep UPDATE_FAILED
push: compile validate package deploy
down:
aws cloudformation delete-stack \
--stack-name $(STACK)