www-apps/gitlab-ce: Add ebuild for version 10.4.4.
Package-Manager: Portage-2.3.19, Repoman-2.3.6
This commit is contained in:
parent
0774052be8
commit
b351ca733a
6 changed files with 760 additions and 1 deletions
|
@ -0,0 +1,96 @@
|
|||
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
|
||||
index f2f05b3..0670112 100644
|
||||
--- a/config/gitlab.yml.example
|
||||
+++ b/config/gitlab.yml.example
|
||||
@@ -502,7 +502,7 @@ production: &base
|
||||
# Gitaly settings
|
||||
gitaly:
|
||||
# Path to the directory containing Gitaly client executables.
|
||||
- client_path: /home/git/gitaly/bin
|
||||
+ client_path: /usr/bin
|
||||
# Default Gitaly authentication token. Can be overriden per storage. Can
|
||||
# be left blank when Gitaly is running locally on a Unix socket, which
|
||||
# is the normal way to deploy Gitaly.
|
||||
@@ -520,8 +520,8 @@ production: &base
|
||||
# real path not the symlink.
|
||||
storages: # You must have at least a `default` storage path.
|
||||
default:
|
||||
- path: /home/git/repositories/
|
||||
- gitaly_address: unix:/home/git/gitlab/tmp/sockets/private/gitaly.socket # TCP connections are supported too (e.g. tcp://host:port)
|
||||
+ path: /var/lib/git/repositories/
|
||||
+ gitaly_address: unix:/run/gitlab/gitaly.socket # TCP connections are supported too (e.g. tcp://host:port)
|
||||
# gitaly_token: 'special token' # Optional: override global gitaly.token for this storage.
|
||||
|
||||
## Backup settings
|
||||
@@ -549,12 +549,12 @@ production: &base
|
||||
|
||||
## GitLab Shell settings
|
||||
gitlab_shell:
|
||||
- path: /home/git/gitlab-shell/
|
||||
- hooks_path: /home/git/gitlab-shell/hooks/
|
||||
+ path: /usr/share/gitlab-shell/
|
||||
+ hooks_path: /usr/share/gitlab-shell/hooks/
|
||||
|
||||
# File that contains the secret key for verifying access for gitlab-shell.
|
||||
# Default is '.gitlab_shell_secret' relative to Rails.root (i.e. root of the GitLab app).
|
||||
- # secret_file: /home/git/gitlab/.gitlab_shell_secret
|
||||
+ secret_file: /opt/gitlab/.gitlab_shell_secret
|
||||
|
||||
# Git over HTTP
|
||||
upload_pack: true
|
||||
@@ -569,7 +569,7 @@ production: &base
|
||||
workhorse:
|
||||
# File that contains the secret key for verifying access for gitlab-workhorse.
|
||||
# Default is '.gitlab_workhorse_secret' relative to Rails.root (i.e. root of the GitLab app).
|
||||
- # secret_file: /home/git/gitlab/.gitlab_workhorse_secret
|
||||
+ # secret_file: /opt/gitlab/.gitlab_workhorse_secret
|
||||
|
||||
## Git settings
|
||||
# CAUTION!
|
||||
@@ -667,8 +667,8 @@ test:
|
||||
backup:
|
||||
path: tmp/tests/backups
|
||||
gitlab_shell:
|
||||
- path: tmp/tests/gitlab-shell/
|
||||
- hooks_path: tmp/tests/gitlab-shell/hooks/
|
||||
+ path: /usr/share/gitlab-shell/
|
||||
+ hooks_path: /usr/share/gitlab-shell/hooks/
|
||||
issues_tracker:
|
||||
redmine:
|
||||
title: "Redmine"
|
||||
diff --git a/config/unicorn.rb.example b/config/unicorn.rb.example
|
||||
index cc10da2..3c80d44 100644
|
||||
--- a/config/unicorn.rb.example
|
||||
+++ b/config/unicorn.rb.example
|
||||
@@ -33,12 +33,12 @@ worker_processes 3
|
||||
|
||||
# Help ensure your application will always spawn in the symlinked
|
||||
# "current" directory that Capistrano sets up.
|
||||
-working_directory "/home/git/gitlab" # available in 0.94.0+
|
||||
+working_directory "/opt/gitlab" # available in 0.94.0+
|
||||
|
||||
# Listen on both a Unix domain socket and a TCP port.
|
||||
# If you are load-balancing multiple Unicorn masters, lower the backlog
|
||||
# setting to e.g. 64 for faster failover.
|
||||
-listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 1024
|
||||
+listen "/run/gitlab/gitlab.socket", :backlog => 1024
|
||||
listen "127.0.0.1:8080", :tcp_nopush => true
|
||||
|
||||
# nuke workers after 30 seconds instead of 60 seconds (the default)
|
||||
@@ -59,13 +59,13 @@ listen "127.0.0.1:8080", :tcp_nopush => true
|
||||
timeout 60
|
||||
|
||||
# feel free to point this anywhere accessible on the filesystem
|
||||
-pid "/home/git/gitlab/tmp/pids/unicorn.pid"
|
||||
+pid "/run/gitlab/pids/unicorn.pid"
|
||||
|
||||
# By default, the Unicorn logger will write to stderr.
|
||||
# Additionally, some applications/frameworks log to stderr or stdout,
|
||||
# so prevent them from going to /dev/null when daemonized here:
|
||||
-stderr_path "/home/git/gitlab/log/unicorn.stderr.log"
|
||||
-stdout_path "/home/git/gitlab/log/unicorn.stdout.log"
|
||||
+stderr_path "/var/log/gitlab/unicorn.stderr.log"
|
||||
+stdout_path "/var/log/gitlab/unicorn.stdout.log"
|
||||
|
||||
# combine Ruby 2.0.0dev or REE with "preload_app true" for memory savings
|
||||
# http://rubyenterpriseedition.com/faq.html#adapt_apps_for_cow
|
64
www-apps/gitlab-ce/files/gitlab-10.4.4-sidekiq.init
Normal file
64
www-apps/gitlab-ce/files/gitlab-10.4.4-sidekiq.init
Normal file
|
@ -0,0 +1,64 @@
|
|||
#!/sbin/openrc-run
|
||||
|
||||
extra_started_commands="check"
|
||||
|
||||
name="GitLab Sidekiq"
|
||||
description="Sidekiq for GitLab"
|
||||
description_check="Runs sanity checks"
|
||||
|
||||
: ${gitlab_user:=@USER@}
|
||||
: ${gitlab_base:="@GITLAB_BASE@"}
|
||||
: ${rails_env:=production}
|
||||
|
||||
: ${sidekiq_pidfile:="/run/gitlab/sidekiq.pid"}
|
||||
: ${sidekiq_logfile:="@LOGS_DIR@/sidekiq.log"}
|
||||
: ${sidekiq_config:="/etc/gitlab/sidekiq_queues.yml"}
|
||||
|
||||
sidekiq_command="/usr/bin/bundle"
|
||||
sidekiq_command_args="exec sidekiq -C ${sidekiq_config} -P ${sidekiq_pidfile} -L ${sidekiq_logfile}"
|
||||
|
||||
check_command="sudo -u ${gitlab_user} -H /usr/bin/bundle"
|
||||
check_command_args1="exec rake gitlab:env:info RAILS_ENV=${rails_env}"
|
||||
check_command_args2="exec rake gitlab:check RAILS_ENV=${rails_env}"
|
||||
|
||||
depend() {
|
||||
need redis gitlab-workhorse
|
||||
use net
|
||||
}
|
||||
|
||||
start() {
|
||||
checkpath -d -o ${gitlab_user} -m755 "$(dirname "${sidekiq_pidfile}")"
|
||||
|
||||
ebegin "Starting ${name} - Sidekiq"
|
||||
|
||||
start-stop-daemon --start \
|
||||
--background --quiet \
|
||||
--chdir "${gitlab_base}" \
|
||||
--user=${gitlab_user} \
|
||||
--pidfile="${sidekiq_pidfile}" \
|
||||
--env RAILS_ENV=${rails_env} \
|
||||
--exec ${sidekiq_command} -- ${sidekiq_command_args}
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping ${name} - Sidekiq"
|
||||
start-stop-daemon --stop \
|
||||
--pidfile="${sidekiq_pidfile}" \
|
||||
--exec ${sidekiq_command}
|
||||
eend $?
|
||||
}
|
||||
|
||||
check() {
|
||||
ebegin "Running sanity checks for ${name}"
|
||||
|
||||
cd /opt/gitlab
|
||||
|
||||
${check_command} ${check_command_args1}
|
||||
|
||||
eend $?
|
||||
|
||||
${check_command} ${check_command_args2}
|
||||
|
||||
eend $?
|
||||
}
|
157
www-apps/gitlab-ce/files/gitlab-10.4.4-unicorn.init
Normal file
157
www-apps/gitlab-ce/files/gitlab-10.4.4-unicorn.init
Normal file
|
@ -0,0 +1,157 @@
|
|||
#!/sbin/openrc-run
|
||||
|
||||
extra_started_commands="restartsidekiq check"
|
||||
extra_stopped_commands="backup"
|
||||
|
||||
name="GitLab"
|
||||
description="GitLab on Unicorns"
|
||||
description_restartsidekiq="Restarts Sidekiq only"
|
||||
description_check="Runs sanity checks"
|
||||
description_backup="Creates a backup of your Gitlab database and files"
|
||||
|
||||
: ${gitlab_user:=@USER@}
|
||||
: ${gitlab_base:="@GITLAB_BASE@"}
|
||||
: ${rails_env:=production}
|
||||
|
||||
: ${server_pidfile:="/run/gitlab/unicorn.pid"}
|
||||
|
||||
: ${sidekiq_pidfile:="/run/gitlab/sidekiq.pid"}
|
||||
: ${sidekiq_logfile:="@LOGS_DIR@/sidekiq.log"}
|
||||
: ${sidekiq_config:="/etc/gitlab/sidekiq_queues.yml"}
|
||||
|
||||
: ${mail_room_pidfile:="/run/gitlab/mail_room.pid"}
|
||||
: ${mail_room_logfile:="@LOGS_DIR@/mail_room.log"}
|
||||
: ${mail_room_config:="/etc/gitlab/mail_room.yml"}
|
||||
|
||||
socket_dir="/run/gitlab"
|
||||
|
||||
server_command="/usr/bin/bundle"
|
||||
server_command_args="exec unicorn_rails -c ${gitlab_base}/config/unicorn.rb -E ${rails_env} -D"
|
||||
|
||||
sidekiq_command="/usr/bin/bundle"
|
||||
sidekiq_command_args="exec sidekiq -C ${sidekiq_config} -P ${sidekiq_pidfile} -L ${sidekiq_logfile}"
|
||||
|
||||
mail_room_command="/usr/bin/bundle"
|
||||
mail_room_command_args="exec mail_room -q -c ${mail_room_config} >> ${mail_room_logfile} 2>&1"
|
||||
|
||||
check_command="sudo -u ${gitlab_user} -H /usr/bin/bundle"
|
||||
check_command_args1="exec rake gitlab:env:info RAILS_ENV=${rails_env}"
|
||||
check_command_args2="exec rake gitlab:check RAILS_ENV=${rails_env}"
|
||||
|
||||
backup_command="sudo -u ${gitlab:user} -H /usr/bin/bundle"
|
||||
backup_args=" exec rake gitlab:backup:create RAILS_ENV=${rails_env}"
|
||||
|
||||
depend() {
|
||||
provide gitlab
|
||||
need redis gitlab-workhorse gitlab-gitaly
|
||||
use net
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting ${name} - Unicorn servers"
|
||||
|
||||
checkpath -d -o ${gitlab_user} -m755 "$(dirname "${server_pidfile}")"
|
||||
checkpath -d -o ${gitlab_user} -m755 "$(dirname "${sidekiq_pidfile}")"
|
||||
checkpath -d -o ${gitlab_user} -m755 "$(dirname "${mail_room_pidfile}")"
|
||||
checkpath -d -o ${gitlab_user} -m700 "${socket_dir}"
|
||||
|
||||
start-stop-daemon --start \
|
||||
--chdir "${gitlab_base}" \
|
||||
--user=${gitlab_user} \
|
||||
--pidfile="${server_pidfile}" \
|
||||
--env RAILS_ENV=${rails_env} \
|
||||
--exec ${server_command} -- ${server_command_args}
|
||||
eend $?
|
||||
|
||||
ebegin "Starting ${name} - Sidekiq"
|
||||
|
||||
start-stop-daemon --start \
|
||||
--background --quiet \
|
||||
--chdir "${gitlab_base}" \
|
||||
--user=${gitlab_user} \
|
||||
--pidfile="${sidekiq_pidfile}" \
|
||||
--env RAILS_ENV=${rails_env} \
|
||||
--exec ${sidekiq_command} -- ${sidekiq_command_args}
|
||||
eend $?
|
||||
|
||||
if [ -e /etc/default/gitlab ]; then
|
||||
. /etc/default/gitlab
|
||||
if [ "${mail_room_enabled}" == "true" ]; then
|
||||
ebegin "Starting ${name} - mail_room"
|
||||
|
||||
start-stop-daemon --start \
|
||||
--background --quiet \
|
||||
--chdir "${gitlab_base}" \
|
||||
--user=${gitlab_user} \
|
||||
--pidfile="${mail_room_pidfile}" -m \
|
||||
--env RAILS_ENV=${rails_env} \
|
||||
--exec ${mail_room_command} -- ${mail_room_command_args}
|
||||
eend $?
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping ${name} - mail_room"
|
||||
start-stop-daemon --stop \
|
||||
--signal QUIT \
|
||||
--pidfile=${mail_room_pidfile} \
|
||||
--exec ${mail_room_command}
|
||||
eend $?
|
||||
|
||||
ebegin "Stopping ${name} - Sidekiq"
|
||||
start-stop-daemon --stop \
|
||||
--pidfile=${sidekiq_pidfile} \
|
||||
--exec ${sidekiq_command}
|
||||
eend $?
|
||||
|
||||
ebegin "Stopping ${name} - Unicorn servers"
|
||||
start-stop-daemon --stop \
|
||||
--signal QUIT \
|
||||
--pidfile=${server_pidfile} \
|
||||
--exec ${server_command}
|
||||
eend $?
|
||||
}
|
||||
|
||||
restartsidekiq() {
|
||||
ebegin "Restarting ${name} - Sidekiq: Stopping"
|
||||
start-stop-daemon --stop \
|
||||
--pidfile=${sidekiq_pidfile} \
|
||||
--exec ${sidekiq_command} \
|
||||
--progress \
|
||||
--retry 180
|
||||
|
||||
eend $?
|
||||
|
||||
ebegin "Starting ${name} - Sidekiq"
|
||||
|
||||
start-stop-daemon --start \
|
||||
--background --quiet \
|
||||
--chdir "${gitlab_base}" \
|
||||
--user=${gitlab_user} \
|
||||
--pidfile="${sidekiq_pidfile}" \
|
||||
--env RAILS_ENV=${rails_env} \
|
||||
--exec ${sidekiq_command} -- ${sidekiq_command_args}
|
||||
eend $?
|
||||
}
|
||||
|
||||
check() {
|
||||
ebegin "Running sanity checks for ${name}"
|
||||
|
||||
cd /opt/gitlab
|
||||
|
||||
${check_command} ${check_command_args1}
|
||||
|
||||
eend $?
|
||||
|
||||
${check_command} ${check_command_args2}
|
||||
|
||||
eend $?
|
||||
}
|
||||
|
||||
backup() {
|
||||
ebegin "Creating backup of ${name}"
|
||||
cd /opt/gitlab
|
||||
${backup_command} ${backup_args}
|
||||
eend $?
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue