-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathweb-services.sh
executable file
·52 lines (41 loc) · 1.15 KB
/
web-services.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
#!/bin/bash
if [ -z "$1" ]
then
echo "No instance argument supplied"
echo "Usage: "$0" instance {start|stop|restart} [docker-compose options]"
exit 1
fi
set -o allexport
source config/$1.env
set +o allexport
if [[ -z "${CODE_BASE_DIR}" ]];
then
CODE_BASE_DIR="../uo-data-box"
fi
case "$2" in
start)
echo "[--] Starting $1 public API and stream services..."
docker-compose --project-name=${UO_INSTANCE} \
-f ${CODE_BASE_DIR}/src/apps/web/docker-compose.yml \
up -d "${@:3}"
echo " "
;;
stop)
echo "[--] Stopping $1 public API and stream services..."
docker-compose --project-name=${UO_INSTANCE} \
-f ${CODE_BASE_DIR}/src/apps/web/docker-compose.yml \
down "${@:3}"
echo " "
;;
restart)
echo "[--] Restarting $1 public web API and streaming services..."
docker-compose --project-name=${UO_INSTANCE} \
-f ${CODE_BASE_DIR}/src/apps/web/docker-compose.yml \
restart "${@:3}"
echo " "
;;
*)
echo "Usage: "$0" instance {start|stop|restart} [docker-compose options]"
exit 1
esac
exit 0