Linux环境下GitLab版本更新步骤
sudo gitlab-backup create(默认备份路径为/var/opt/gitlab/backups)。sudo cp /etc/gitlab/gitlab-secrets.json /backup/location/、sudo cp /etc/gitlab/gitlab.rb /backup/location/。sudo gitlab-rake gitlab:env:info(显示版本、数据库类型等信息);或通过Web界面访问http://your-gitlab-url/help(顶部显示版本号)。curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash;sudo gitlab-ctl stop unicorn、sudo gitlab-ctl stop sidekiq、sudo gitlab-ctl stop nginx。sudo apt-get update(更新包索引)、sudo apt-get install gitlab-ce=<target-version>(替换为目标版本号,如15.2.5-ce.0);sudo yum update gitlab-ce或sudo rpm -Uvh gitlab-ce-<version>.rpm。sudo gitlab-ctl reconfigure(自动应用gitlab.rb中的配置);sudo gitlab-ctl restart(启动unicorn、sidekiq、nginx等组件)。http://your-gitlab-url/help,确认顶部显示的版本号已更新;或通过命令行:sudo gitlab-rake gitlab:check(显示当前版本及环境状态)。sudo gitlab-rake db:migrate:status(所有迁移状态应为“已启动”);sudo gitlab-ctl status,确认所有GitLab组件(unicorn、sidekiq、nginx等)均处于“run”状态,无错误提示。sudo apt-get install -f修复依赖)。docker pull gitlab/gitlab-ce:latest、docker-compose down、docker-compose up -d(需提前备份/srv/gitlab目录下的数据卷)。