-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunserver.sh
executable file
·61 lines (45 loc) · 990 Bytes
/
runserver.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
56
57
58
59
60
#!/bin/sh
help() {
echo
echo "Usage: ./runserver.sh [options]"
echo " Options:"
echo " -b Update runnning server with rebuilding"
echo " -m Run on M1 Architecture"
echo " -s [service-name] Run only specific service. Select one among maria_rdb, common_api_server"
}
# ERROR CODE
INVALID_ARGUMENT=3
# resolve option
while getopts "bhms:" opt
do
case $opt in
b) build=true ;;
h) help && exit 0 ;;
m) m1=true ;;
s) service=$OPTARG ;;
esac
done
filename=docker-compose.dev.yaml
command="docker-compose -f ${filename}"
# m1 architecture case
if [ $m1 ]
then
command="${command} -f docker-compose.dev-m1.yaml"
fi
command="${command} up -d"
# rebuild case
if [ $build ]
then
command="${command} --build"
fi
# select service
case $service in
rdb) service=maria_rdb ;;
server) service=common_api_server ;;
esac
if [ $service ]
then
command="${command} ${service}"
fi
echo "COMMAND: $command"
$command