-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·55 lines (46 loc) · 1.26 KB
/
deploy.sh
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
#!/bin/bash
stage=${1:-dev}
install_deps() {
if [ "$CI" == "true" ]; then # If we're in a CI system
if [ ! -d "node_modules" ]; then # If we don't have any node_modules (CircleCI cache miss scenario), run npm ci. Otherwise, we're all set, do nothing.
npm ci --legacy-peer-deps
fi
else # We're not in a CI system, let's npm install
npm install --legacy-peer-deps
fi
}
deploy() {
pushd services/$1
install_deps
serverless deploy --stage $stage
popd
}
install_deps
# Run deploy for each folder
services=(
'ui'
'uploads'
'app-api'
'email'
'one-stream'
'seatool-sink'
'ui-waf-log-assoc'
'ui-auth'
'ui-src'
'admin'
)
# Only deploy for higher envs
if [[ "$stage" == "develop" || "$stage" == "master" || "$stage" == "production" ]]; then
services+=('source')
services+=('cross-acct')
fi
set -e
for i in "${services[@]}"; do
deploy $i
done
echo """
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Application endpoint: `./services/output.sh services/ui ApplicationEndpointUrl $stage`
------------------------------------------------------------------------------------------------
"""