環境介紹:mysql
CentOS6.7nginx
gitlab:8.6.5git
需求:gitlab從8.6.5升級到8.11.7sql
第1、gitlab8.6.5安裝shell
參考《GitLab完整搭建(8.6.5).docx》bash
第2、gitlab8.6.5升級ide
0.升級以前. Backup備份
gitlab
It's useful to make a backup just in case things go south: (With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version)post
#su - git $cd /home/git/gitlab $bundle exec rake gitlab:backup:create RAILS_ENV=production
備份的文件在/home/git/gitlab/tmp/backups目錄下:fetch
1. 中止服務
#service gitlab stop
2.獲取最新版本分支代碼
In the commands below, replace LATEST_TAG with the latest GitLab tag you want to update to, for example v8.0.3. Use git tag -l 'v*.[0-9]' --sort='v:refname' to see a list of all tags. Make sure to update patch versions only (check your current version with cat VERSION).
$su - git $cd /home/git/gitlab $git fetch --all $git checkout -- Gemfile.lock db/schema.rb $git checkout v8.11.7 -b v8.11.7
若是報錯,刪除修改過的文件
$vi VERSION
將8.6.5替換爲8.11.7
3.升級gitlab-shell版本
$cd /home/git/gitlab-shell $git fetch $git checkout v`cat /home/git/gitlab/GITLAB_SHELL_VERSION` -b v`cat /home/git/gitlab/GITLAB_SHELL_VERSION`
4.升級gitlab-workhorse版本
$cd /home/git/gitlab-workhorse $git fetch $git checkout v`cat /home/git/gitlab/GITLAB_WORKHORSE_VERSION` -b v`cat /home/git/gitlab/GITLAB_WORKHORSE_VERSION` $make
5.安裝庫環境
$cd /home/git/gitlab
# PostgreSQL(若是數據爲psql用這條命令)
$bundle install --without development test mysql --deployment
# MySQL(若是數據爲mysql用這條命令)
$bundle install --without development test postgres --deployment
# Optional: clean up old gems
$bundle clean
# Run database migrations
$bundle exec rake db:migrate RAILS_ENV=production
# Clean up assets and cache
$bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production
6.啓動gitlab相關服務
#service gitlab start #service nginx restart
7.檢查程序狀態
檢查GitLab及其環境是否配置正確:
$bundle exec rake gitlab:env:info RAILS_ENV=production
確保沒有報錯,運行一次更完全的檢查:
$bundle exec rake gitlab:check RAILS_ENV=production
若是全部項目是綠色的,那麼恭喜你升級完成!
gitlab從8.6.5升級到8.11.7到此結束。