From 34cf0b2c011d5e479f9dc0be56e931fefc499c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20S=C3=89RIE?= Date: Wed, 6 Jun 2018 14:13:02 +0200 Subject: [PATCH] new upgrade script --- gitlab_upgrade_minor10.4.7_to_10.6.6.sh | 77 +++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 gitlab_upgrade_minor10.4.7_to_10.6.6.sh diff --git a/gitlab_upgrade_minor10.4.7_to_10.6.6.sh b/gitlab_upgrade_minor10.4.7_to_10.6.6.sh new file mode 100644 index 0000000..50b9dfa --- /dev/null +++ b/gitlab_upgrade_minor10.4.7_to_10.6.6.sh @@ -0,0 +1,77 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +gitlabUser="$1" +gitlabVersion="10.6.6" + +cd /home/${gitlabUser}/gitlab + +# Config file +echo "Manual merge needed!! Press enter to continue." +read +vimdiff config/gitlab.yml <(git show origin/10-6-stable:config/gitlab.yml.example) + +# Do a backup +sudo -u $gitlabUser -H bundle exec rake gitlab:backup:create RAILS_ENV=production + +# Fetch $gitlabVersion +sudo -u $gitlabUser -H git fetch --all -p +sudo -u $gitlabUser -H git fetch -t +sudo -u $gitlabUser -H git checkout -- Gemfile.lock db/schema.rb yarn.lock locale +sudo -u $gitlabUser -H git checkout -B v${gitlabVersion} tags/v${gitlabVersion} +#sudo -u $gitlabUser -H git pull origin v${gitlabVersion} +sudo -u $gitlabUser -H sed -i -e s'/app_user="git"/app_user="'$gitlabUser'"/' \ + -e 's/# Provides: .*gitlab$/# Provides: '$gitlabUser'/' \ + lib/support/init.d/gitlab +sudo -u $gitlabUser -H sed -i 's#script_path = "/etc/init.d/gitlab"#script_path = "/etc/init.d/'$gitlabUser'"#g' \ + lib/tasks/gitlab/check.rake +install -m 755 /home/${gitlabUser}/gitlab/lib/support/init.d/gitlab /etc/init.d/${gitlabUser} +sudo -u $gitlabUser -H git commit -a --amend -m 'change default user' + +# gitlab-shell +cd /home/${gitlabUser}/gitlab-shell +sudo -u $gitlabUser -H git fetch --all +sudo -u $gitlabUser -H git checkout -B v$(