-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
67 lines (59 loc) · 1.27 KB
/
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
set -e
start() {
exec_cmd=$1
if [ -f "$RIOCONF/$CONF_FILE" ]
then
$2
else
$exec_cmd start
fi
}
case $1 in
controller)
daemon_name="rioos-controller-manager"
RUN_CMD="$SOURCE_DIR/$daemon_name --v=4 --api-server=$API_SERVER \
--dns-endpoint=$DNS_ENDPOINT --dns-apikey=$DNS_APIKEY \
--dns-provider=$DNS_PROVIDER"
start $daemon_name $RUN_CMD
break
;;
apiserver)
daemon_name="rioos-apiserver"
RUN_CMD="$SOURCE_DIR/$daemon_name start --config $RIOCONF/$CONF_FILE"
start "$daemon_name" "$RUN_CMD"
break
;;
blockchain)
daemon_name="rioos-blockchain-server"
RUN_CMD="$SOURCE_DIR/$daemon_name start --config $RIOCONF/$CONF_FILE"
start "$daemon_name" "$RUN_CMD"
break
;;
scheduler)
daemon_name="rioos-scheduler"
RUN_CMD="$SOURCE_DIR/$daemon_name --v=4 --leader-elect=false \
--api-server=$API_SERVER"
start $daemon_name $RUN_CMD
break
;;
marketplace)
daemon_name="rioos-marketplaces"
RUN_CMD="$SOURCE_DIR/$daemon_name start --config $RIOCONF/$CONF_FILE"
start "$daemon_name" "$RUN_CMD"
break
;;
ui)
if [ -f "$RIOCONF/$CONF_FILE" ]
then
$SOURCE_DIR/$1 --config=$RIOCONF/$CONF_FILE
else
$SOURCE_DIR/ember server --port 4200 --live-reload-port 49153
fi
break
;;
*)
echo >&2 "error: $1 not match"
;;
esac
exec "$@"