-
Notifications
You must be signed in to change notification settings - Fork 1
/
start.sh
executable file
·50 lines (45 loc) · 985 Bytes
/
start.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
startNetwork() {
pushd network
./network.sh restart
popd
}
startBackend() {
echo 'starting backend...'
docker-compose -f ./backend/docker-compose.yaml up -d
echo 'done'
}
startFrontend() {
echo 'starting frontend...'
cp ./nginx/nginx.conf /usr/share/nginx
echo 'stopping nginx'
nginx -s stop
echo 'restarting nginx'
nginx -c /usr/share/nginx/nginx.conf
echo 'done'
}
enrollAdmin() {
for org in shipper transporter warehouse consignee; do
pushd backend/$org
npm run enroll
popd
done
}
CMD=$1
echo "./start.sh $CMD"
if [ "$CMD" == "all" ]; then
startNetwork
enrollAdmin
startBackend
startFrontend
elif [ "$CMD" == "network" ]; then
startNetwork
elif [ "$CMD" == "backend" ]; then
startBackend
elif [ "$CMD" == "frontend" ]; then
startFrontend
elif [ "$CMD" == "enroll" ]; then
enrollAdmin
else
echo "args: all, network, backend or frontend"
fi