-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-entrypoint.sh
38 lines (32 loc) · 1.06 KB
/
docker-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
#!/bin/bash
#enable job control in script
set -e -m
##### variables #####
: ${SSH_PASS:=jenkins}
# add command if needed
if [ "${1:0:1}" = '-' ]; then
set -- supervisord "$@"
fi
#run command in background
if [ "$1" = 'supervisord' ]; then
##### run scripts #####
echo "========================================================================"
echo "startup "
echo "========================================================================"
exec "$@" &
##### post scripts #####
echo "========================================================================"
echo "migration databases "
echo "========================================================================"
sentinel=/opt/jumpserver/data/inited
if [ -f ${sentinel} ];then
echo "database have been inited"
else
cd /opt/jumpserver/utils
./make_migrations.sh && echo "database init success" && touch $sentinel
fi
#bring command to foreground
fg
else
exec "$@"
fi