aboutsummaryrefslogtreecommitdiffstats
path: root/www/gitlab-ce
diff options
context:
space:
mode:
authormfechner <mfechner@FreeBSD.org>2018-07-19 05:54:56 +0800
committermfechner <mfechner@FreeBSD.org>2018-07-19 05:54:56 +0800
commit80c6d63e167da05c76aa9043d6711e61c00ed80d (patch)
tree19dd97bc93e218d61e9f3ab35148eeae22a5f9fe /www/gitlab-ce
parent1c224a746a62a4fedc2f9efd34e14422fed4e9c4 (diff)
downloadfreebsd-ports-gnome-80c6d63e167da05c76aa9043d6711e61c00ed80d.tar.gz
freebsd-ports-gnome-80c6d63e167da05c76aa9043d6711e61c00ed80d.tar.zst
freebsd-ports-gnome-80c6d63e167da05c76aa9043d6711e61c00ed80d.zip
Made it possible to use another PREFIX for gitlab-ce.
Reviewed by: swills (mentor) Approved by: swills (mentor) Differential Revision: https://reviews.freebsd.org/D16266
Diffstat (limited to 'www/gitlab-ce')
-rw-r--r--www/gitlab-ce/Makefile6
-rw-r--r--www/gitlab-ce/files/gitlab.in12
-rw-r--r--www/gitlab-ce/files/patch-config_gitlab.yml.example12
-rw-r--r--www/gitlab-ce/files/patch-config_unicorn.rb.example10
-rw-r--r--www/gitlab-ce/files/patch-lib_support_nginx_gitlab4
-rw-r--r--www/gitlab-ce/files/patch-lib_support_nginx_gitlab-ssl4
6 files changed, 27 insertions, 21 deletions
diff --git a/www/gitlab-ce/Makefile b/www/gitlab-ce/Makefile
index eb4334a491fb..ca1eef73a50a 100644
--- a/www/gitlab-ce/Makefile
+++ b/www/gitlab-ce/Makefile
@@ -222,6 +222,12 @@ GROUPS= git
NO_ARCH= yes
NO_BUILD= yes
+post-patch:
+ ${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|" ${WRKSRC}/config/gitlab.yml.example \
+ ${WRKSRC}/config/unicorn.rb.example \
+ ${WRKSRC}/lib/support/nginx/gitlab \
+ ${WRKSRC}/lib/support/nginx/gitlab-ssl
+
post-patch-MYSQL-on:
${CP} ${WRKSRC}/config/database.yml.mysql ${WRKSRC}/config/database.yml.sample
diff --git a/www/gitlab-ce/files/gitlab.in b/www/gitlab-ce/files/gitlab.in
index 0411c0912b45..7cd77ea48a13 100644
--- a/www/gitlab-ce/files/gitlab.in
+++ b/www/gitlab-ce/files/gitlab.in
@@ -24,7 +24,7 @@
#
# gitlab_enable="YES"
-PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
+PATH="/sbin:/bin:/usr/sbin:/usr/bin:%%LOCALBASE%%/sbin:%%LOCALBASE%%/bin"
. /etc/rc.subr
@@ -51,7 +51,7 @@ RAILS_ENV="production"
# Script variable names should be lower-case not to conflict with
# internal /bin/sh variables such as PATH, EDITOR or SHELL.
app_user="git"
-app_root="/usr/local/www/gitlab-ce"
+app_root="%%PREFIX%%/www/gitlab-ce"
pid_path="$app_root/tmp/pids"
socket_path="$app_root/tmp/sockets"
rails_socket="$socket_path/gitlab.socket"
@@ -79,7 +79,7 @@ gitlab_pages_options="-pages-domain example.com -pages-root $app_root/shared/pag
gitlab_pages_log="$app_root/log/gitlab-pages.log"
shell_path="/bin/bash"
gitaly_enabled=true
-gitaly_dir="/usr/local/share/gitaly"
+gitaly_dir="%%PREFIX%%/share/gitaly"
gitaly_pid_path="$pid_path/gitaly.pid"
gitaly_log="$app_root/log/gitaly.log"
@@ -91,18 +91,18 @@ if [ "$USER" != "$app_user" ]; then
# Regenerate the Gemfile.lock for all related products
echo "Regenerate Gitlab Gemfile.lock"
rm -f "${app_root}"/Gemfile.lock
- if ! su -l ${app_user} -c "cd ${app_root} && /usr/local/bin/bundle install --local --quiet"; then
+ if ! su -l ${app_user} -c "cd ${app_root} && %%LOCALBASE%%/bin/bundle install --local --quiet"; then
echo "Could not create Gemfile.lock for gitlab, please report this using FreeBSD Bugtracker, https://bugs.freebsd.org/"
exit 1
fi
echo "Regenerate Gitaly Gemfile.lock"
rm -f "${gitaly_dir}"/ruby/Gemfile.lock
- if ! su -l root -c "cd ${gitaly_dir}/ruby && /usr/local/bin/bundle install --local --quiet"; then
+ if ! su -l root -c "cd ${gitaly_dir}/ruby && %%LOCALBASE%%/bin/bundle install --local --quiet"; then
echo "Could not create Gemfile.lock for gitaly, please report this using FreeBSD Bugtracker, https://bugs.freebsd.org/"
exit 1
fi
- eval su - "$app_user" -c $(echo \")/usr/local/etc/rc.d/gitlab "$@"$(echo \"); exit;
+ eval su - "$app_user" -c $(echo \")%%LOCALBASE%%/etc/rc.d/gitlab "$@"$(echo \"); exit;
fi
# Switch to the gitlab path, exit on failure.
diff --git a/www/gitlab-ce/files/patch-config_gitlab.yml.example b/www/gitlab-ce/files/patch-config_gitlab.yml.example
index be7cd37caa31..65e61752490e 100644
--- a/www/gitlab-ce/files/patch-config_gitlab.yml.example
+++ b/www/gitlab-ce/files/patch-config_gitlab.yml.example
@@ -5,7 +5,7 @@
# external_https: ["1.1.1.1:443", "[2001::1]:443"] # If defined, enables custom domain and certificate support in GitLab Pages
admin:
- address: unix:/home/git/gitlab/tmp/sockets/private/pages-admin.socket # TCP connections are supported too (e.g. tcp://host:port)
-+ address: unix:/usr/local/www/gitlab-ce/tmp/sockets/private/pages-admin.socket # TCP connections are supported too (e.g. tcp://host:port)
++ address: unix:%%PREFIX%%/www/gitlab-ce/tmp/sockets/private/pages-admin.socket # TCP connections are supported too (e.g. tcp://host:port)
## Mattermost
## For enabling Add to Mattermost button
@@ -14,7 +14,7 @@
gitaly:
# Path to the directory containing Gitaly client executables.
- client_path: /home/git/gitaly/bin
-+ client_path: /usr/local/share/gitaly/bin
++ client_path: %%PREFIX%%/share/gitaly/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.
@@ -25,7 +25,7 @@
- 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: /usr/home/git/repositories/
-+ gitaly_address: unix:/usr/local/www/gitlab-ce/tmp/sockets/private/gitaly.socket # TCP connections are supported too (e.g. tcp://host:port)
++ gitaly_address: unix:%%PREFIX%%/www/gitlab-ce/tmp/sockets/private/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
@@ -35,8 +35,8 @@
gitlab_shell:
- path: /home/git/gitlab-shell/
- hooks_path: /home/git/gitlab-shell/hooks/
-+ path: /usr/local/share/gitlab-shell/
-+ hooks_path: /usr/local/share/gitlab-shell/hooks/
++ path: %%PREFIX%%/share/gitlab-shell/
++ hooks_path: %%PREFIX/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).
@@ -50,7 +50,7 @@
# Use the default values unless you really know what you are doing
git:
- bin_path: /usr/bin/git
-+ bin_path: /usr/local/bin/git
++ bin_path: %%PREFIX%%/bin/git
## Webpack settings
# If enabled, this will tell rails to serve frontend assets from the webpack-dev-server running
diff --git a/www/gitlab-ce/files/patch-config_unicorn.rb.example b/www/gitlab-ce/files/patch-config_unicorn.rb.example
index 63c49ea60042..b3a531c5e732 100644
--- a/www/gitlab-ce/files/patch-config_unicorn.rb.example
+++ b/www/gitlab-ce/files/patch-config_unicorn.rb.example
@@ -5,13 +5,13 @@
# 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 "/usr/local/www/gitlab-ce" # available in 0.94.0+
++working_directory "%%PREFIX%%/www/gitlab-ce" # 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 "/usr/local/www/gitlab-ce/tmp/sockets/gitlab.socket", :backlog => 1024
++listen "%%PREFIX%%/www/gitlab-ce/tmp/sockets/gitlab.socket", :backlog => 1024
listen "127.0.0.1:8080", :tcp_nopush => true
# nuke workers after 30 seconds instead of 60 seconds (the default)
@@ -20,15 +20,15 @@
# feel free to point this anywhere accessible on the filesystem
-pid "/home/git/gitlab/tmp/pids/unicorn.pid"
-+pid "/usr/local/www/gitlab-ce/tmp/pids/unicorn.pid"
++pid "%%PREFIX%%/www/gitlab-ce/tmp/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 "/usr/local/www/gitlab-ce/log/unicorn.stderr.log"
-+stdout_path "/usr/local/www/gitlab-ce/log/unicorn.stdout.log"
++stderr_path "%%PREFIX%%/www/gitlab-ce/log/unicorn.stderr.log"
++stdout_path "%%PREFIX%%/www/gitlab-ce/log/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
diff --git a/www/gitlab-ce/files/patch-lib_support_nginx_gitlab b/www/gitlab-ce/files/patch-lib_support_nginx_gitlab
index 577803428fd6..01b5765dc550 100644
--- a/www/gitlab-ce/files/patch-lib_support_nginx_gitlab
+++ b/www/gitlab-ce/files/patch-lib_support_nginx_gitlab
@@ -5,7 +5,7 @@
# Gitlab socket file,
# for Omnibus this would be: unix:/var/opt/gitlab/gitlab-workhorse/socket
- server unix:/home/git/gitlab/tmp/sockets/gitlab-workhorse.socket fail_timeout=0;
-+ server unix:/usr/local/www/gitlab-ce/tmp/sockets/gitlab-workhorse.socket fail_timeout=0;
++ server unix:%%PREFIX%%/www/gitlab-ce/tmp/sockets/gitlab-workhorse.socket fail_timeout=0;
}
map $http_upgrade $connection_upgrade_gitlab {
@@ -14,7 +14,7 @@
# Location to the Gitlab's public directory,
# for Omnibus this would be: /opt/gitlab/embedded/service/gitlab-rails/public.
- root /home/git/gitlab/public;
-+ root /usr/local/www/gitlab-ce/public;
++ root %%PREFIX%%/www/gitlab-ce/public;
internal;
}
diff --git a/www/gitlab-ce/files/patch-lib_support_nginx_gitlab-ssl b/www/gitlab-ce/files/patch-lib_support_nginx_gitlab-ssl
index db4a605d02bc..df232286815a 100644
--- a/www/gitlab-ce/files/patch-lib_support_nginx_gitlab-ssl
+++ b/www/gitlab-ce/files/patch-lib_support_nginx_gitlab-ssl
@@ -5,7 +5,7 @@
# Gitlab socket file,
# for Omnibus this would be: unix:/var/opt/gitlab/gitlab-workhorse/socket
- server unix:/home/git/gitlab/tmp/sockets/gitlab-workhorse.socket fail_timeout=0;
-+ server unix:/usr/local/www/gitlab-ce/tmp/sockets/gitlab-workhorse.socket fail_timeout=0;
++ server unix:%%PREFIX%%/www/gitlab-ce/tmp/sockets/gitlab-workhorse.socket fail_timeout=0;
}
map $http_upgrade $connection_upgrade_gitlab_ssl {
@@ -14,7 +14,7 @@
# Location to the Gitlab's public directory,
# for Omnibus this would be: /opt/gitlab/embedded/service/gitlab-rails/public
- root /home/git/gitlab/public;
-+ root /usr/local/www/gitlab-ce/public;
++ root %%PREFIX%%/www/gitlab-ce/public;
internal;
}
}