前一篇文章《在 Ubuntu 12.04 上安裝 GitLab6.x》 http://www.linuxidc.com/Linux/2013-08/89292.htm 已經介紹了安裝Gitlab6.2的過程,那麼怎麼升級他呢?
GitLab 的詳細介紹:請點這裡
GitLab 的下載地址:請點這裡
1. 備份
cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
2. 停止gitlab服務
sudo service gitlab stop
3. 獲取最新的發行版本
cd /home/git/gitlab
sudo -u git -H git fetch
刪除原來的application.rb文件
sudo -u git rm -rf config/application.rb
檢出新版本
sudo -u git -H git checkout 6-3-stable
4. 升級gitlab-shell
cd /home/git/gitlab-shell
sudo -u git -H git fetch
sudo -u git -H git checkout v1.8.0
5. 安裝庫並遷移他
以MySQL為例
cd /home/git/gitlab
sudo -u git -H bundle install --without development test postgres --deployment
遷移數據庫
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
清除緩沖
sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production
6. 升級配置文件
cd /home/git/gitlab
sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb
7. 升級啟動腳本
sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
sudo chmod +x /etc/init.d/gitlab
8. 重啟
sudo service gitlab start
sudo service nginx restart
附:
檢查Gitlab環境信息
檢查Gitlab情況