-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
50 lines (44 loc) · 1.36 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
#!/bin/bash
set -e
source ${GITLAB_RUNTIME_DIR}/functions
[[ $DEBUG == true ]] && set -x
case ${1} in
app:init|app:start|app:sanitize|app:rake)
initialize_system
configure_gitlab
configure_gitlab_shell
configure_nginx
# patching gilab to allow shorter passwords
sed -i -e 's;config.password_length = .\.\.128;config.password_length = 2..128;' /home/git/gitlab/config/initializers/devise.rb
case ${1} in
app:start)
migrate_database
rm -rf /var/run/supervisor.sock
printenv | sed 's/^\(.*\)\=\(.*\)$/export \1\="\2"/g' | sort > /.env
exec /usr/bin/supervisord -nc /etc/supervisor/supervisord.conf
;;
app:init)
migrate_database
;;
app:sanitize)
sanitize_datadir
;;
app:rake)
shift 1
execute_raketask $@
;;
esac
;;
app:help)
echo "Available options:"
echo " app:start - Starts the gitlab server (default)"
echo " app:init - Initialize the gitlab server (e.g. create databases, compile assets), but don't start it."
echo " app:sanitize - Fix repository/builds directory permissions."
echo " app:rake <task> - Execute a rake task."
echo " app:help - Displays the help"
echo " [command] - Execute the specified command, eg. bash."
;;
*)
exec "$@"
;;
esac