Updated gitlab_upgrade_minor9.1.0_to_9.3.11.sh

This commit is contained in:
Benoît.S 2017-09-19 09:32:40 +02:00
parent 7d67f43872
commit d68b304b91
1 changed files with 17 additions and 10 deletions

View File

@ -15,10 +15,18 @@ if ! test -d "/home/${gitlabUser}/gitaly"; then
cd /home/${gitlabUser}/gitaly
sudo -u $gitlabUser -H cp config.toml{.example,}
sudo -u $gitlabUser -H sed -i "s#/home/git/#/home/${gitlabUser}/#g" config.toml
cd -
fi
# Config file
cd /home/${gitlabUser}/gitlab
echo "Manual merge needed!! Press enter to continue."
read
vimdiff config/gitlab.yml <(git show origin/9-3-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
sudo -u $gitlabUser -H git checkout -- Gemfile.lock db/schema.rb
sudo -u $gitlabUser -H git checkout -B v${gitlabVersion} tags/v${gitlabVersion}
@ -34,15 +42,15 @@ 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$(cat /home/${gitlabUser}/gitlab/GITLAB_SHELL_VERSION) \
tags/v$(cat /home/${gitlabUser}/gitlab/GITLAB_SHELL_VERSION)
sudo -u $gitlabUser -H git checkout -B v$(</home/${gitlabUser}/gitlab/GITLAB_SHELL_VERSION) \
tags/v$(</home/${gitlabUser}/gitlab/GITLAB_SHELL_VERSION)
sudo -u $gitlabUser -H bin/compile
# gitlab-workhorse
cd /home/${gitlabUser}/gitlab-workhorse
sudo -u $gitlabUser -H git fetch --all
sudo -u $gitlabUser -H git checkout -B v$(cat /home/${gitlabUser}/gitlab/GITLAB_WORKHORSE_VERSION) \
tags/v$(cat /home/${gitlabUser}/gitlab/GITLAB_WORKHORSE_VERSION)
sudo -u $gitlabUser -H git checkout -B v$(</home/${gitlabUser}/gitlab/GITLAB_WORKHORSE_VERSION) \
tags/v$(</home/${gitlabUser}/gitlab/GITLAB_WORKHORSE_VERSION)
sudo -u $gitlabUser -H make
# clean and install gems
@ -57,18 +65,17 @@ sudo -u $gitlabUser -H git checkout v$(</home/${gitlabUser}/gitlab/GITALY_SERVER
sudo -u $gitlabUser -H cp config.toml{.example,}
sudo -u $gitlabUser -H sed -i "s#/home/git/#/home/${gitlabUser}/#g" config.toml
sudo -u $gitlabUser -H make
cd -
echo "Manual merge needed!! Press enter to continue."
read
sudo -u $gitlabUser -H vimdiff config/gitlab.yml <(git show origin/9-3-stable:config/gitlab.yml.example)
# db:migrate, assets, ...
cd /home/${gitlabUser}/gitlab
sudo -u $gitlabUser -H bundle exec rake db:migrate RAILS_ENV=production
sudo -u $gitlabUser -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production
sudo -u $gitlabUser -H bundle exec rake gettext:compile RAILS_ENV=production
sudo -u $gitlabUser -H bundle exec rake cache:clear RAILS_ENV=production
sudo -u $gitlabUser -H git commit -a --amend -m "upgraded to $gitlabVersion"
# Restart and check the installation
/etc/init.d/${gitlabUser} restart
cd /home/${gitlabUser}/gitlab
sudo -u $gitlabUser -H bundle exec rake gitlab:env:info RAILS_ENV=production
sudo -u $gitlabUser -H bundle exec rake gitlab:check RAILS_ENV=production
cd