Date: Wed, 18 Jul 2018 21:54:56 +0000 (UTC) From: Matthias Fechner <mfechner@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r474906 - in head/www/gitlab-ce: . files Message-ID: <201807182154.w6ILsuG6049410@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mfechner Date: Wed Jul 18 21:54:56 2018 New Revision: 474906 URL: https://svnweb.freebsd.org/changeset/ports/474906 Log: 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 Modified: head/www/gitlab-ce/Makefile head/www/gitlab-ce/files/gitlab.in head/www/gitlab-ce/files/patch-config_gitlab.yml.example head/www/gitlab-ce/files/patch-config_unicorn.rb.example head/www/gitlab-ce/files/patch-lib_support_nginx_gitlab head/www/gitlab-ce/files/patch-lib_support_nginx_gitlab-ssl Modified: head/www/gitlab-ce/Makefile ============================================================================== --- head/www/gitlab-ce/Makefile Wed Jul 18 21:53:13 2018 (r474905) +++ head/www/gitlab-ce/Makefile Wed Jul 18 21:54:56 2018 (r474906) @@ -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 Modified: head/www/gitlab-ce/files/gitlab.in ============================================================================== --- head/www/gitlab-ce/files/gitlab.in Wed Jul 18 21:53:13 2018 (r474905) +++ head/www/gitlab-ce/files/gitlab.in Wed Jul 18 21:54:56 2018 (r474906) @@ -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 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. Modified: head/www/gitlab-ce/files/patch-config_gitlab.yml.example ============================================================================== --- head/www/gitlab-ce/files/patch-config_gitlab.yml.example Wed Jul 18 21:53:13 2018 (r474905) +++ head/www/gitlab-ce/files/patch-config_gitlab.yml.example Wed Jul 18 21:54:56 2018 (r474906) @@ -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 Modified: head/www/gitlab-ce/files/patch-config_unicorn.rb.example ============================================================================== --- head/www/gitlab-ce/files/patch-config_unicorn.rb.example Wed Jul 18 21:53:13 2018 (r474905) +++ head/www/gitlab-ce/files/patch-config_unicorn.rb.example Wed Jul 18 21:54:56 2018 (r474906) @@ -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 Modified: head/www/gitlab-ce/files/patch-lib_support_nginx_gitlab ============================================================================== --- head/www/gitlab-ce/files/patch-lib_support_nginx_gitlab Wed Jul 18 21:53:13 2018 (r474905) +++ head/www/gitlab-ce/files/patch-lib_support_nginx_gitlab Wed Jul 18 21:54:56 2018 (r474906) @@ -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; } Modified: head/www/gitlab-ce/files/patch-lib_support_nginx_gitlab-ssl ============================================================================== --- head/www/gitlab-ce/files/patch-lib_support_nginx_gitlab-ssl Wed Jul 18 21:53:13 2018 (r474905) +++ head/www/gitlab-ce/files/patch-lib_support_nginx_gitlab-ssl Wed Jul 18 21:54:56 2018 (r474906) @@ -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; } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807182154.w6ILsuG6049410>