参考官方文档:
https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update
本地服务器为4.0.1版本
1)4.0.1->4.1
sudo service gitlab stop
cd /home/gitlab/gitlab/
sudo -u gitlab -H git fetch
sudo -u gitlab -H git stash
sudo -u gitlab -H git checkout 4-1-stable
sudo -u gitlab -H vim Gemfile
修改内容为:modernizr 改为modernizr-rails 版本 2.7.1
Gemfile.lock同样修改
注册mysql gem:
sudo -u gitlab -H bundle install --without development test postgres
sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production
sudo mv /etc/init.d/gitlab /etc/init.d/gitlab.old
sudo curl --location --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/4-1-stable/init.d/gitlab
sudo chmod +x /etc/init.d/gitlab
cp /home/gitlab/gitlab/lib/hooks/post-receive /home/git/.gitolite/hooks/common/post-receive
chown git:git /home/git/.gitolite/hooks/common/post-receive
检查信息:
sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production
service gitlab start