mirror of
https://github.com/sameersbn/docker-gitlab.git
synced 2025-07-20 16:47:42 +00:00

- It requires database is set up because feature flags are stored to DB (table `application_settings`) - Add configuration parameter GITLAB_FEATURE_FLAGS_ENABLE_TARGETS and GITLAB_FEATURE_FLAGS_DISABLE_TARGETS - Add ruby script to configure feature flags from command line and invoke runtime (from configure_gitlab())
57 lines
1.5 KiB
Bash
Executable File
57 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
set -o pipefail
|
|
|
|
# shellcheck source=assets/runtime/functions
|
|
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_gitlab_pages
|
|
configure_nginx
|
|
|
|
case ${1} in
|
|
app:start)
|
|
/usr/bin/supervisord -nc /etc/supervisor/supervisord.conf &
|
|
SUPERVISOR_PID=$!
|
|
migrate_database
|
|
kill -15 $SUPERVISOR_PID
|
|
if ps h -p $SUPERVISOR_PID > /dev/null ; then
|
|
wait $SUPERVISOR_PID || true
|
|
fi
|
|
rm -rf /var/run/supervisor.sock
|
|
configure_gitlab_requires_db
|
|
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
|