gitlab从8.6.5升级到8.11.7(补丁版本通用更新指南)

环境介绍: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

wKiom1frhlbzsMP7AAA0mXxlHYA897.png

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

wKiom1fsaZ-Djn9PAABEfHi7t78064.png-wh_50

若是报错,删除修改过的文件

wKioL1fsacjiA5gaAABYeIISWxk567.png

wKioL1fsahbjiwxPAAAZ_aT_64w102.png

$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`

wKioL1fsaluA35j3AADjm0LhbCI228.png-wh_50

wKiom1fsanSxCfA8AABUjqBC1bo090.png

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

wKioL1fsasfgezH9AAGNbvJMcsE945.png-wh_50

wKioL1fsavOjIlO_AABNfibyUIw811.png-wh_50

wKioL1fsavOzyJwxAAEFqG_n5M8167.png-wh_50


5.安装库环境

$cd /home/git/gitlab


# PostgreSQL(若是数据为psql用这条命令)

$bundle install --without development test mysql --deployment


# MySQL(若是数据为mysql用这条命令)

$bundle install --without development test postgres --deployment


wKioL1fsa0qCgoUVAAD9MtSFGJA578.png-wh_50

# Optional: clean up old gems

$bundle clean


# Run database migrations

$bundle exec rake db:migrate RAILS_ENV=production


wKiom1fsa2bB9DgtAAD46QVO7Ag481.png-wh_50

# Clean up assets and cache

$bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production


wKiom1fsa4KibGncAAG7sO2gBqM090.png-wh_50

6.启动gitlab相关服务

#service gitlab start
#service nginx restart

wKioL1fsa6vggDMPAABkPig9EYE238.png-wh_50

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到此结束。

wKioL1fskR_CwdfeAAAvjMQc_uk049.png

相关文章
相关标签/搜索