Created
December 26, 2016 16:35
-
-
Save zehome/8e0469b1bdbf8f9349166937c6c25bc2 to your computer and use it in GitHub Desktop.
Upgrading source installation of gitlab in one script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
version="v8.15.1" | |
systemctl stop gitlab | |
cd /home/git/gitlab | |
echo Stash | |
sudo -u git -H git stash | |
echo Fetch | |
sudo -u git -H git fetch | |
echo Checkout ${version} | |
sudo -u git -H git checkout ${version} | |
echo Update gitlab-shell | |
( | |
cd /home/git/gitlab-shell | |
sudo -u git -H git fetch | |
sudo -u git -H git checkout v$(cat /home/git/gitlab/GITLAB_SHELL_VERSION) | |
) | |
echo Update gitlab-workhorse | |
( | |
cd /home/git/gitlab-workhorse | |
sudo -u git -H git fetch | |
sudo -u git -H git checkout v$(cat /home/git/gitlab/GITLAB_WORKHORSE_VERSION) | |
) | |
echo "Build deps (bundle)" | |
gem install bundler | |
sudo -u git -H bundle | |
echo DB Migrations | |
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production | |
echo Clean assets | |
sudo -u git -H bundle exec rake assets:clean RAILS_ENV=production | |
echo Build assets | |
sudo -u git -H bundle exec rake assets:clean assets:precompile RAILS_ENV=production | |
echo Clean cache | |
sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production | |
echo Install new init | |
cd /home/git/gitlab | |
cp lib/support/init.d/gitlab /etc/init.d/gitlab | |
systemctl daemon-reload | |
echo Restart gitlab | |
systemctl start gitlab | |
echo Checking installation | |
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment