Terry : Upgrade GitLab From 6.2 To 6.3

GitLab 6.3

v 6.3.0

  • API for adding gitlab-ci service
  • Init script now waits for pids to appear after (re)starting before reporting status (Rovanion Luckey)
  • Restyle project home page
  • Grammar fixes
  • Show branches list (which branches contains commit) on commit page (Andrew Kumanyaev)
  • Security improvements
  • Added support for GitLab CI 4.0
  • Fixed issue with 500 error when group did not exist
  • Ability to leave project
  • You can create file in repo using UI
  • You can remove file from repo using UI
  • API: dropped default_branch attribute from project during creation
  • Project default_branch is not stored in db any more. It takes from repo now.
  • Admin broadcast messages
  • UI improvements
  • Don't show last push widget if user removed this branch
  • Fix 500 error for repos with newline in file name
  • Extended html titles
  • API: create/update/delete repo files
  • Admin can transfer project to any namespace
  • API: projects/all for admin users
  • Fix recent branches order

Upgrade Steps

0. Backup saves lives in case things go south: (With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version)

cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production

1. Stop Server

sudo service gitlab stop

2. Get the latest code

cd /home/git/gitlab
sudo -u git -H git fetch
sudo -u git -H git checkout 6-3-stable

3. Update gitlab-shell and its config

cd /home/git/gitlab-shell
sudo -u git -H git fetch
sudo -u git -H git checkout v1.7.9 # Addresses multiple critical security vulnerabilities

NOTE: The Gitlab-shell config changed recently, so check for config file changes and make /home/git/gitlab-shell/config.yml the same as https://github.com/gitlabhq/gitlab-shell/blob/master/config.yml.example

4. Install additional packages

# Add support for lograte for better log file handling
sudo apt-get install logrotate

5. Install libs, migration etc

cd /home/git/gitlab

sudo -u git -H bundle install --without development test postgres --deployment

sudo -u git -H bundle install --without development test mysql --deployment

sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
sudo -u git -H bundle exec rake assets:clean RAILS_ENV=production
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production

6. Update config files

Tip: to see what changed in gitlab.yml.example in this release use next command

git diff 6-2-stable:config/gitlab.yml.example 6-3-stable:config/gitlab.yml.example
git diff 6-1-stable:config/gitlab.yml.example 6-3-stable:config/gitlab.yml.example # if you upgrading from 6-1

Make /home/git/gitlab/config/gitlab.yml same as https://github.com/gitlabhq/gitlabhq/blob/6-3-stable/config/gitlab.yml.example but with your settings.

Make /home/git/gitlab/config/unicorn.rb same as https://github.com/gitlabhq/gitlabhq/blob/6-3-stable/config/unicorn.rb.example but with your settings.

 Copy rack attack middleware config

sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb

Set up logrotate

sudo cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab

7. Update Init scripts

# Backup the old init scriptsudo cp /etc/init.d/gitlab{,.old}sudo rm /etc/init.d/gitlab# Download the new init script# curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/6-3-stable/lib/support/init.d/gitlab
# OR
wget --no-check-certificate -O /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/6-3-stable/lib/support/init.d/gitlab
chmod +x /etc/init.d/gitlab

8. Start Application

sudo service gitlab start
sudo service nginx restart

9. Check Application Status

Check if GitLab and its environment are configured correctly

cd /home/gitlab
su - git
bundle exec rake gitlab:env:info RAILS_ENV=production

To make sure you didn't miss anything run a more thorough check with

bundle exec rake gitlab:check RAILS_ENV=production

If all items are green, then congratulations upgrade complete!