-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.sh
More file actions
43 lines (37 loc) · 1002 Bytes
/
deploy.sh
File metadata and controls
43 lines (37 loc) · 1002 Bytes
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
usage() { echo "Usage:
$0 [-e <development|production>] [-p <string>]
-e deployment environment, defaults to DEPLOYMENT_ENV
-p profile to be used by the CDK, defaults to PROFILE
" 1>&2; exit 1; }
env=${DEPLOYMENT_ENV}
profile=${PROFILE}
while getopts ":e:p:" o; do
case "${o}" in
e)
env=${OPTARG}
;;
p)
profile=${OPTARG}
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "${env}" ]; then
usage
fi
echo "INSTALLING NPMs"
# add all npm installs here
echo "npm install"
npm install
echo "npm --prefix ./opt/push_microservice_layer install"
npm --prefix ./opt/push_microservice_layer install
if [ -z "${profile}" ]; then
echo "CDK DEPLOYMENT: DEPLOYMENT_ENV=${env} cdk deploy"
DEPLOYMENT_ENV=${env} cdk deploy
else
echo "CDK DEPLOYMENT: DEPLOYMENT_ENV=${env} cdk deploy --profile=${profile}"
DEPLOYMENT_ENV=${env} cdk deploy --profile="${profile}"
fi