[arch-commits] Commit in gitlab-gitaly/trunk (PKGBUILD configs.patch)

Anatol Pomozov anatolik at archlinux.org
Tue May 26 08:42:37 UTC 2020


    Date: Tuesday, May 26, 2020 @ 08:42:37
  Author: anatolik
Revision: 635013

upgpkg: gitlab-gitaly 13.0.0-2: FS#66774 Adjust configs for the new file locations

Added:
  gitlab-gitaly/trunk/configs.patch
Modified:
  gitlab-gitaly/trunk/PKGBUILD

---------------+
 PKGBUILD      |   20 ++++-------
 configs.patch |   95 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 102 insertions(+), 13 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-05-26 08:33:27 UTC (rev 635012)
+++ PKGBUILD	2020-05-26 08:42:37 UTC (rev 635013)
@@ -5,7 +5,7 @@
 # need this again at some point in the future.
 pkgname=gitlab-gitaly
 pkgver=13.0.0
-pkgrel=1
+pkgrel=2
 pkgdesc="Speed up Git access using caching"
 arch=('x86_64')
 url="https://gitlab.com/gitlab-org/gitaly"
@@ -16,18 +16,17 @@
 backup=("etc/gitlab-gitaly/config.toml")
 _tag=v${pkgver}
 source=("https://gitlab.com/gitlab-org/gitaly/-/archive/${_tag}/gitaly-${_tag}.tar.gz"
+        "configs.patch"
         "gitlab-gitaly.service")
 sha512sums=('dc8cac8fec10e1d60acc192478a718ee8f0e059f84cfbfea77ff33f109b41aa26e6a232a948830598926d648170b3fff2116139d9c184ec398f295c1cc3a77a5'
+            '28bfb8f290d6d6206b75e2f35d8fd15b298baa005b533648550f224c6bf4fd16eeda4e2b8ff3231873ef208172f391a553956684f81867451bc08b7ad18d581f'
             'e6c31cab200424af118ee9da4def0963a52727f33025fdbdb515c6c1337a9b32f4a377bd925fdd33ffe7b91371ce1d5d70847e07c2b73eac1e85d3f38f5e1261')
 
-_homedir="/var/lib/gitlab"
-
 prepare() {
   cd gitaly-$_tag
 
-  sed -i "s|dir = \"/home/git/gitaly/ruby\"|dir = \"/usr/share/webapps/gitlab-gitaly/ruby\"|" config.toml.example
-  sed -i "s|dir = \"/home/git/gitlab-shell\"|dir = \"/usr/share/webapps/gitlab-shell\"|" config.toml.example
-  sed -i "s|bin_dir = \"/home/git/gitaly\"|bin_dir = \"/usr/bin\"|" config.toml.example
+  patch -p1 < ../configs.patch
+  # At this point the config file should not contain any references to '/home/git'
 
   # https://github.com/bundler/bundler/issues/6882
   sed -e '/BUNDLED WITH/,+1d' -i ruby/Gemfile.lock
@@ -44,16 +43,11 @@
   cd gitaly-$_tag
 
   make PREFIX=/usr DESTDIR=${pkgdir} install
-  mkdir -p "${pkgdir}/etc/${pkgname}"
-  sed \
-    -e "s|^socket_path =.*|socket_path = \"${_homedir}/sockets/gitlab-gitaly.socket\"|" \
-    -e "s|^path =.*|path = \"${_homedir}/repositories\"|" \
-    config.toml.example > "${pkgdir}/etc/${pkgname}/config.toml"
-
+  mkdir -p ${pkgdir}/etc/gitlab-gitaly
   mkdir -p ${pkgdir}/usr/share/webapps/gitlab-gitaly
   cp -r ruby ${pkgdir}/usr/share/webapps/gitlab-gitaly/ruby
 
-  install -Dm644 config.toml.example "${pkgdir}/usr/share/${pkgname}/config.toml.example"
+  install -Dm644 config.toml.example "${pkgdir}/etc/${pkgname}/config.toml"
   install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
   install -Dm0644 "${srcdir}/gitlab-gitaly.service" "${pkgdir}/usr/lib/systemd/system/gitlab-gitaly.service"
 }

Added: configs.patch
===================================================================
--- configs.patch	                        (rev 0)
+++ configs.patch	2020-05-26 08:42:37 UTC (rev 635013)
@@ -0,0 +1,95 @@
+commit e70c0ab485e0ee789ae2d3c2657f8b3ad5f2a6db
+Author: Anatol Pomozov <anatol.pomozov at gmail.com>
+Date:   Tue May 26 00:26:02 2020 -0700
+
+    Patch config files with Arch Linux specific locations
+    
+    Arch uses upstream's default config files as a base for its configs.
+    But directory structure at Arch is completely different from the default
+    one specified by gitlab project.
+    We used to have a lot of seds expressions to adjust the files but as
+    complexity of configs grew 'sed' makes it easy to miss a changed/added
+    option.
+    
+    Track set of diffs as a patch. If upstream modifies config file then it
+    will cause a conflict that needs to be reviewed manually.
+
+diff --git a/config.toml.example b/config.toml.example
+index aaab83c2..46bbad26 100644
+--- a/config.toml.example
++++ b/config.toml.example
+@@ -2,10 +2,10 @@
+ # Documentation lives at https://docs.gitlab.com/ee/administration/gitaly/ and
+ # https://docs.gitlab.com/ee//administration/gitaly/reference
+ 
+-socket_path = "/home/git/gitlab/tmp/sockets/private/gitaly.socket"
++socket_path = "/run/gitlab/gitlab-gitaly.socket"
+ 
+ # The directory where Gitaly's executables are stored
+-bin_dir = "/home/git/gitaly"
++bin_dir = "/usr/bin"
+ 
+ # # Optional: listen on a TCP socket. This is insecure (no authentication)
+ # listen_addr = "localhost:9999"
+@@ -17,7 +17,7 @@ bin_dir = "/home/git/gitaly"
+ # # Optional: configure where the Gitaly creates the sockets for internal connections. If unset, Gitaly will create a randomly
+ # # named temp directory each time it boots.
+ # # Non Gitaly clients should never connect to these sockets.
+-# internal_socket_dir = "/home/git/gitlab/tmp/sockets/private/internal"
++# internal_socket_dir = "/run/gitlab/private"
+ 
+ # # Optional: authenticate Gitaly requests using a shared secret
+ # [auth]
+@@ -25,8 +25,8 @@ bin_dir = "/home/git/gitaly"
+ # transitioning = false # Set `transitioning` to true to temporarily allow unauthenticated while rolling out authentication.
+ 
+ # [tls]
+-# certificate_path = '/home/git/cert.cert'
+-# key_path = '/home/git/key.pem'
++# certificate_path = '/var/lib/gitlab/cert.cert'
++# key_path = '/var/lib/gitlab/key.pem'
+ 
+ # # Git settings
+ # [git]
+@@ -35,7 +35,7 @@ bin_dir = "/home/git/gitaly"
+ 
+ [[storage]]
+ name = "default"
+-path = "/home/git/repositories"
++path = "/var/lib/gitlab/repositories"
+ 
+ # # You can optionally configure more storages for this Gitaly instance to serve up
+ #
+@@ -47,7 +47,7 @@ path = "/home/git/repositories"
+ # # You can optionally configure Gitaly to output JSON-formatted log messages to stdout
+ # [logging]
+ # # The directory where Gitaly stores extra log files
+-dir = "/home/git/gitlab/log"
++dir = "/var/log/gitlab"
+ # format = "json"
+ # # Optional: Set log level to only log entries with that severity or above
+ # # One of, in order: debug, info, warn, errror, fatal, panic
+@@ -65,7 +65,7 @@ dir = "/home/git/gitlab/log"
+ 
+ [gitaly-ruby]
+ # The directory where gitaly-ruby is installed
+-dir = "/home/git/gitaly/ruby"
++dir = "/usr/share/webapps/gitlab-gitaly/ruby"
+ 
+ # # Gitaly-ruby resident set size (RSS) that triggers a memory restart (bytes)
+ # max_rss = 200000000
+@@ -85,10 +85,10 @@ dir = "/home/git/gitaly/ruby"
+ 
+ [gitlab-shell]
+ # The directory where gitlab-shell is installed
+-dir = "/home/git/gitlab-shell"
+-secret_file = "/home/git/gitlab-shell/.gitlab_shell_secret"
+-custom_hooks_dir = "/home/git/custom_hooks"
+-gitlab_url = "http://localhost:8080"
++dir = "/usr/share/webapps/gitlab-shell"
++secret_file = "/etc/webapps/gitlab-shell/secret"
++custom_hooks_dir = "/var/lib/gitlab/custom_hooks"
++gitlab_url = "http+unix://%2Frun%2Fgitlab%2Fgitlab.socket"
+ 
+ [gitlab-shell.http-settings]
+ # read_timeout = 300



More information about the arch-commits mailing list