summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Maclennan2021-05-07 22:29:44 +0300
committerCaleb Maclennan2021-05-07 22:29:49 +0300
commit3543f817692f06a4d87fa912e2cd1a99a9d84257 (patch)
treed697c920447881993a6cb97a25148aa729144e3c
parent8a2807e871b1ce0faf8c5bf0683c2892da1e7ff5 (diff)
downloadaur-3543f817692f06a4d87fa912e2cd1a99a9d84257.tar.gz
Match ruby bundle version with GitLab dependency
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD14
-rw-r--r--gitlab-post.sh6
3 files changed, 14 insertions, 10 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b9fd4124627..14cbbb67abb 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = gitlab-upgrade-hook
pkgdesc = Automatically shut down, run db:migrate, then start services after upgrade
pkgver = 1
- pkgrel = 1
+ pkgrel = 2
arch = any
depends = pacman-contrib
source = gitlab-pre.hook
@@ -9,7 +9,7 @@ pkgbase = gitlab-upgrade-hook
source = gitlab-post.sh
sha256sums = 6996bb8e24142a050642dfe932907d1d4e6af74ecea392706d9407863458470e
sha256sums = aa5f9a9f4af3b190e2ca52ffc567c3a35374877e5e8d39a34dcdb753cde22c7e
- sha256sums = 00aba3b1cf8d58e400e4dff195b1eba0c1379331b1fec9c11fcb3b6b8b58a749
+ sha256sums = 3b05e6d3ddbc76715f13e8c11a63969c85ae04066b314fab49ed626ac7a90265
pkgname = gitlab-upgrade-hook
diff --git a/PKGBUILD b/PKGBUILD
index b02b89f06e0..977c157f9c6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,19 +2,19 @@
pkgname=gitlab-upgrade-hook
pkgver=1
-pkgrel=1
+pkgrel=2
pkgdesc='Automatically shut down, run db:migrate, then start services after upgrade'
arch=('any')
depends=('pacman-contrib')
source=('gitlab-pre.hook'
- 'gitlab-post.hook'
- 'gitlab-post.sh'
- )
+ 'gitlab-post.hook'
+ 'gitlab-post.sh')
sha256sums=('6996bb8e24142a050642dfe932907d1d4e6af74ecea392706d9407863458470e'
'aa5f9a9f4af3b190e2ca52ffc567c3a35374877e5e8d39a34dcdb753cde22c7e'
- '00aba3b1cf8d58e400e4dff195b1eba0c1379331b1fec9c11fcb3b6b8b58a749')
+ '3b05e6d3ddbc76715f13e8c11a63969c85ae04066b314fab49ed626ac7a90265')
package() {
- install -D -m0644 -t "$pkgdir/usr/share/libalpm/hooks/" gitlab-{pre,post}.hook
- install -D -m0755 -t "$pkgdir/usr/share/libalpm/scripts/" gitlab-post.sh
+ local _libalpm="$pkgdir/usr/share/libalpm"
+ install -Dm0644 -t "$_libalpm/hooks/" gitlab-{pre,post}.hook
+ install -Dm0755 -t "$_libalpm/scripts/" gitlab-post.sh
}
diff --git a/gitlab-post.sh b/gitlab-post.sh
index 0d59f30fe03..1fd1760a3ac 100644
--- a/gitlab-post.sh
+++ b/gitlab-post.sh
@@ -1,4 +1,8 @@
#!/bin/bash
-(cd /usr/share/webapps/gitlab ; su -s /bin/sh gitlab -c "$(cat environment | xargs) bundle-2.7 exec rake db:migrate")
+_ruby=$(pacman -Qiq gitlab | awk '{/^Depends On/ && match($0,/\<ruby[0-9.]*\>/,a)}END{print a[0]}')
+_bundle=$(pacman -Qlq "$_ruby" | grep '/usr/bin/bundle\>')
+
+cd /usr/share/webapps/gitlab
+su -s /bin/sh gitlab -c "$(xargs < environment ) $_bundle exec rake db:migrate"
systemctl start gitlab.target