forked from Enterprise-CMCS/macpro-mdct-qmr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·50 lines (41 loc) · 1.11 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
#!/bin/bash
set -e
stage=${1:-dev}
services=(
'database'
'app-api'
'uploads'
'ui'
'ui-auth'
'ui-src'
)
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 yarn install --frozen-lockfile. Otherwise, we're all set, do nothing.
yarn install --frozen-lockfile
fi
else # We're not in a CI system, let's yarn install
yarn install
fi
}
install_deps_per_service() {
service=$1
pushd services/$service
install_deps
popd
}
install_deps
export PATH=$(pwd)/node_modules/.bin/:$PATH
for i in "${services[@]}"
do
install_deps_per_service $i
done
serverless deploy --stage $stage
pushd services
echo """
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Application endpoint: `./output.sh ui CloudFrontEndpointUrl $stage`
------------------------------------------------------------------------------------------------
"""
popd