forked from fagongzi/manba
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
executable file
·52 lines (41 loc) · 881 Bytes
/
entrypoint.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/sh
set -e
start_etcd() {
etcd $ETCD_OPTS &
}
DEFAULT_IP="0.0.0.0"
start_apiserver() {
manba-apiserver --addr=${DEFAULT_IP}:9092 --addr-http=${DEFAULT_IP}:9093 --discovery $API_SERVER_OPTS &
}
INPUT_CMD=$@
CMD=`cat cmd`
if [ "$INPUT_CMD" = "" ]
then
INPUT_CMD=${CMD}
fi
DEFAULT_EXEC="manba-proxy --addr=${DEFAULT_IP}:80 --log-level=$MANBA_LOG_LEVEL $GW_PROXY_OPTS"
if [ "${INPUT_CMD}" = 'demo' ]
then
start_etcd
sleep 3
start_apiserver
sleep 1
EXEC=$DEFAULT_EXEC
fi
if [ "${INPUT_CMD}" = 'proxy' ]
then
EXEC=$DEFAULT_EXEC
fi
if [ "${INPUT_CMD}" = 'apiserver' ]
then
EXEC="apiserver --addr=${DEFAULT_IP}:9092 --addr-http=${DEFAULT_IP}:9093 --discovery $API_SERVER_OPTS"
fi
if [ "${INPUT_CMD}" = 'etcd' ]
then
EXEC="etcd $ETCD_OPTS"
fi
if [ ! -z "${INPUT_CMD}" ] && [ -z "$EXEC" ]
then
EXEC=${INPUT_CMD}
fi
exec $EXEC