45 lines
1.0 KiB
Plaintext
45 lines
1.0 KiB
Plaintext
|
#!/sbin/runscript
|
||
|
|
||
|
name="GitLab support"
|
||
|
description="Support for GitLab @SLOT@"
|
||
|
|
||
|
: ${gitlab_user:=@GIT_USER@}
|
||
|
: ${gitlab_group:=@GIT_GROUP@}
|
||
|
: ${gitlab_home:="@DEST_DIR@"}
|
||
|
|
||
|
: ${sidekiq_pidfile:="@DEST_DIR@/tmp/pids/sidekiq.pid"}
|
||
|
: ${sidekiq_log:="@LOG_DIR@/sidekiq.log"}
|
||
|
|
||
|
: ${rails_env:=production}
|
||
|
|
||
|
bundle="/usr/bin/bundle"
|
||
|
sidekiq_command="/usr/bin/bundle"
|
||
|
sidekiq_start_command_args="exec rake sidekiq:start RAILS_ENV=${rails_env}"
|
||
|
sidekiq_stop_command_args="exec rake sidekiq:stop RAILS_ENV=${rails_env}"
|
||
|
|
||
|
if [ ${rails_env} = development ]; then
|
||
|
sidekiq_args+=" VVERBOSE=1"
|
||
|
fi
|
||
|
|
||
|
depend() {
|
||
|
provide gitlab
|
||
|
need redis
|
||
|
use net
|
||
|
}
|
||
|
|
||
|
start() {
|
||
|
|
||
|
ebegin "Starting GitLab @SLOT@ Sidekiq"
|
||
|
checkpath -d -o "${gitlab_user}:${gitlab_group}" -m750 "$(dirname "${sidekiq_pidfile}")"
|
||
|
cd "${gitlab_home}"
|
||
|
sudo -u git -H ${sidekiq_command} ${sidekiq_start_command_args}
|
||
|
eend $?
|
||
|
}
|
||
|
|
||
|
stop() {
|
||
|
ebegin "Stopping GitLab @SLOT@ Sidekiq"
|
||
|
cd "${gitlab_home}"
|
||
|
sudo -u git -H ${sidekiq_command} ${sidekiq_stop_command_args}
|
||
|
eend $?
|
||
|
}
|