summarylogtreecommitdiffstats
path: root/gitlab-post.sh
blob: 62c43f90e53ba9c668542dab783e36e690d62eb1 (plain)
1
2
3
4
5
6
7
8
9
#!/bin/bash

_ruby=$(pacman -Qiq gitlab | awk '{/^Depends On/ && match($0,/\<ruby[0-9.]*\>/,a)}END{print a[0]}')
_bundle=$(pacman -Qlq "$_ruby-bundler" | grep -m1 '/usr/bin/bundle\>')

cd /usr/share/webapps/gitlab
su -s /bin/sh gitlab -c "$(xargs < environment ) $_bundle exec rake db:migrate"
(cd /usr/share/webapps/gitlab && sudo -u gitlab $(cat environment | xargs) bundle exec rake db:migrate)
systemctl start gitlab.target