-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
Makefile
106 lines (87 loc) · 3.39 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
NAME ?= aws-python-auth0-custom-authorizers-api
ERROR_COLOR = \033[1;31m
INFO_COLOR = \033[1;32m
WARN_COLOR = \033[1;33m
NO_COLOR = \033[0m
#################
#
# Deploy Targets
#
#################
.PHONY: deploy
deploy: vendor ## wrap sls deploy
@make action=deploy sls
sls: guard-action
@if [ -n "$${AWS_ACCESS_KEY_ID}" -a -n "$${AWS_SECRET_ACCESS_KEY}" ] ; then \
printf "$(WARN_COLOR)WARN:$(NO_COLOR) Found AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY vars, using those for sls "$${action}".\n" ; \
sls "$${action}" ; \
elif [ -n "$${AWS_DEFAULT_PROFILE}" ] ; then \
printf "$(WARN_COLOR)WARN:$(NO_COLOR) Found AWS_DEFAULT_PROFILE var, using it for sls "$${action}".\n" ; \
sls "$${action}" --aws-profile=$${AWS_DEFAULT_PROFILE} ; \
elif [ -n "$${profile}" ] ; then \
printf "$(INFO_COLOR)INFO:$(NO_COLOR) Found 'profile=$${profile}' argument, using it for sls "$${action}".\n" ; \
sls "$${action}" --aws-profile=$${profile} --verbose --aws-s3-accelerate ; \
elif [ -z "$${profile}" ] ; then \
printf "$(WARN_COLOR)WARN:$(NO_COLOR) No AWS profile specified, using default.\n" ; \
sls "$${action}" ; \
else \
printf "$(ERROR_COLOR)ERROR:$(NO_COLOR) No AWS credentials found or passed.\n" ; \
cd .. && make sls_help ; \
exit 1 ; \
fi
#################
#
# Docker Targets
#
#################
check-docker:
@if which docker &>/dev/null ; then \