-
Notifications
You must be signed in to change notification settings - Fork 495
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·70 lines (64 loc) · 1.94 KB
/
Copy pathentrypoint.sh
File metadata and controls
executable file
·70 lines (64 loc) · 1.94 KB
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
68
69
70
#!/bin/bash
set -e
source ${REDMINE_RUNTIME_ASSETS_DIR}/functions
[[ $DEBUG == true ]] && set -x
case ${1} in
app:init|app:start|app:rake|app:runner|app:backup:create|app:backup:restore)
initialize_system
configure_redmine
configure_nginx
case ${1} in
app:start)
version_check
migrate_database
# themes before plugins: install_plugins recompiles assets, which must
# see themes already in place. See test/theme-recompile-ordering.sh
install_themes
install_plugins
if [[ -f ${REDMINE_DATA_DIR}/entrypoint.custom.sh ]]; then
echo "Executing entrypoint.custom.sh..."
. ${REDMINE_DATA_DIR}/entrypoint.custom.sh
fi
rm -rf /var/run/supervisor.sock
exec /usr/bin/supervisord -nc /etc/supervisor/supervisord.conf
;;
app:init)
version_check
migrate_database
# themes before plugins (see app:start)
install_themes
install_plugins
;;
app:rake)
shift 1
execute_raketask $@
;;
app:runner)
shift 1
execute_runner "$@"
;;
app:backup:create)
shift 1
backup_create $@
;;
app:backup:restore)
shift 1
backup_restore $@
;;
esac
;;
app:help)
echo "Available options:"
echo " app:start - Starts the Redmine server (default)"
echo " app:init - Initialize the Redmine server (e.g. create databases, install plugins/themes), but don't start it."
echo " app:rake <task> - Execute a rake task."
echo " app:runner <code> - Execute ruby code or a script via 'rails runner'."
echo " app:backup:create - Create a backup."
echo " app:backup:restore - Restore an existing backup."
echo " app:help - Displays the help"
echo " [command] - Execute the specified command, eg. bash."
;;
*)
exec "$@"
;;
esac