-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
72 lines (62 loc) · 1.85 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
.DEFAULT_GOAL ?= help
.PHONY: help
.PHONY: default
default: help;
help:
@echo "Name: ${Product}-${Project}"
@echo "Description: ${Description}"
@echo "Credits: zoph.io - https://zoph.io"
@echo ""
@echo "Available commands:"
@echo " build - build artifacts ${Product} for ${Project}"
@echo " deploy - deploy ${Product} for ${Project} - also run 'build' command"
@echo " ---"
@echo " delete - delete ${Product} for ${Project}"
@echo " clean - clean the build folder and artifacts"
###################### Parameters ######################
Product := subnet-watcher
Project := myproject
Environment := sandbox
AWSRegion := eu-west-1
# Alerting
PercentageRemainingWarning := 5
AlertsRecipient := [email protected]
# Generated
Description := ${Product} - ${Project} - ${Environment}
#######################################################
build: clean
sam build
deploy: build
sam deploy \
-t .aws-sam/build/template.yaml \
--region ${AWSRegion} \
--stack-name "${Project}-${Product}-${Environment}" \
--capabilities CAPABILITY_IAM \
--resolve-s3 \
--force-upload \
--parameter-overrides \
pProjectName=${Project} \
pProductName=${Product} \
pDescription='${Description}' \
pEnv=${Environment} \
pAWSRegion=${AWSRegion} \
pAlertsRecipient='${AlertsRecipient}' \
pPercentageRemainingWarning=${PercentageRemainingWarning} \
--no-fail-on-empty-changeset
delete:
sam delete --stack-name "${Project}-${Product}-${Environment}"
clean:
@rm -fr build/
@rm -fr dist/
@rm -fr htmlcov/
@rm -fr site/
@rm -fr .eggs/
@rm -fr .tox/
@rm -fr .aws-sam/
@find . -name '*.egg-info' -exec rm -fr {} +
@find . -name '.DS_Store' -exec rm -fr {} +
@find . -name '*.egg' -exec rm -f {} +
@find . -name '*.pyc' -exec rm -f {} +
@find . -name '*.pyo' -exec rm -f {} +
@find . -name '*~' -exec rm -f {} +
@find . -name '__pycache__' -exec rm -fr {} +