當前GitLab版本由寶塔自動安裝的8.8.5,但截止至2018-06-12,CentOS的GitLab官方最新版本爲10.8.4,顯然版本相差較大,故打算跨版本升級至最新版 php
GitLab社區版不支持直接跨版本升級,需按照官方指南一步步向上升級,若版本越舊,須要跨的版本就越多 html
安裝包國內選擇清華鏡像站速度較快,教育網還有蜜汁加成node
若升級其餘版本也可自行Ctrl+F
python
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-8.17.7-ce.0.el7.x86_64.rpm
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-9.5.8-ce.0.el7.x86_64.rpm
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.1.4-ce.0.el7.x86_64.rpm
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.8.4-ce.0.el7.x86_64.rpm
複製代碼
關閉GitLab核心服務nginx
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
gitlab-ctl stop nginx
複製代碼
安裝8.17.7git
rpm -Uvh gitlab-ce-8.17.7-ce.0.el7.x86_64.rpm
複製代碼
若以前從寶塔安裝後未配置GitLab的Nginx啓動命令則須要自行配置後才能正常啓動,操做見文章GitLab修改配置後nginx沒法啓動 重啓服務redis
[root@localhost ~]# gitlab-ctl restart
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/omnibus-ctl-0.3.6/lib/omnibus-ctl.rb:533: warning: Insecure world writable dir /www/server/nvm/versions/node/v8.11.2/bin in PATH, mode 040777
ok: run: gitlab-workhorse: (pid 39809) 1s
ok: run: logrotate: (pid 39821) 0s
ok: run: nginx: (pid 39828) 0s
ok: run: postgresql: (pid 39835) 0s
ok: run: redis: (pid 39844) 0s
ok: run: sidekiq: (pid 39849) 1s
ok: run: unicorn: (pid 39854) 0s
複製代碼
重啓後稍等片刻便可訪問,查看版本號,已經更新爲8.17.7,後續步驟同上 sql
部分CentOS版本較低未自帶policycoreutils-python
組件可能沒法升級至10.x,須要手動ruby
yum -y install policycoreutils-python
複製代碼
更新到10.x後明顯啓動項都變多了bash
[root@localhost ~]# gitlab-ctl restart
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/omnibus-ctl-0.5.0/lib/omnibus-ctl.rb:684: warning: Insecure world writable dir /www/server/nvm/versions/node/v8.11.2/bin in PATH, mode 040777
ok: run: alertmanager: (pid 45330) 1s
ok: run: gitaly: (pid 45336) 0s
ok: run: gitlab-monitor: (pid 45346) 1s
ok: run: gitlab-workhorse: (pid 45362) 0s
ok: run: logrotate: (pid 45369) 1s
ok: run: nginx: (pid 45378) 0s
ok: run: node-exporter: (pid 45383) 0s
ok: run: postgres-exporter: (pid 45387) 1s
ok: run: postgresql: (pid 45394) 0s
ok: run: prometheus: (pid 45476) 1s
ok: run: redis: (pid 45484) 0s
ok: run: redis-exporter: (pid 45488) 1s
ok: run: sidekiq: (pid 45493) 0s
ok: run: unicorn: (pid 45503) 1s
複製代碼
查看版本號,成功