UpdateGitLab

IT
IT
IT
335
文章
1
评论
2020年6月30日15:55:57 评论 1,103 2882字阅读9分36秒

介绍

更新您的GitLab安装,以利用最新功能。

官网地址

根据自己的系统,选择对应的版本进行升级。比如我用的centos7系统,我就选择centos7

UpdateGitLab

UpdateGitLab

更新

  • 更新前备份自己的数据,使用的是社区版。
[root@iZ2ze2jlupmjlwwfuyg30gZ ~]# gitlab-rake gitlab:backup:create STRATEGY=copy
2020-06-30 19:47:44 +0800 -- Dumping database ...
Dumping PostgreSQL database gitlabhq_production ... [DONE]
2020-06-30 19:47:45 +0800 -- done
2020-06-30 19:47:45 +0800 -- Dumping repositories ...
2020-06-30 19:47:45 +0800 -- done
2020-06-30 19:47:45 +0800 -- Dumping uploads ...
2020-06-30 19:47:45 +0800 -- done
2020-06-30 19:47:45 +0800 -- Dumping builds ...
2020-06-30 19:47:45 +0800 -- done
2020-06-30 19:47:45 +0800 -- Dumping artifacts ...
2020-06-30 19:47:45 +0800 -- done
2020-06-30 19:47:45 +0800 -- Dumping pages ...
2020-06-30 19:47:45 +0800 -- done
2020-06-30 19:47:45 +0800 -- Dumping lfs objects ...
2020-06-30 19:47:45 +0800 -- done
2020-06-30 19:47:45 +0800 -- Dumping container registry images ...
2020-06-30 19:47:45 +0800 -- [DISABLED]
Creating backup archive: 1593517665_2020_06_30_11.9.9_gitlab_backup.tar ... done
Uploading backup archive to remote storage  ... skipped
Deleting tmp directories ... done
done
done
done
done
done
done
done
Deleting old backups ... skipping
  • 查看备份
[root@iZ2ze2jlupmjlwwfuyg30gZ ~]# ls /var/opt/gitlab/backups
1593517665_2020_06_30_11.9.9_gitlab_backup.tar

 

更新GitLab

  • 更新前查看版本
[root@iZ2ze2jlupmjlwwfuyg30gZ ~]# cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
11.9.9
  • 更新
[root@gitlab ~]# yum install -y gitlab-ce
  • 如果你是yum方式安装的,可以使用以上方式升级,博主使用的是rpm包,所以得去下载个rpm包进行升级。
[root@iZ2ze2jlupmjlwwfuyg30gZ ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.0.9-ce.0.el7.x86_64.rpm
[root@iZ2ze2jlupmjlwwfuyg30gZ ~]# gitlab-ctl stop unicorn
ok: down: unicorn: 1s, normally up
[root@iZ2ze2jlupmjlwwfuyg30gZ ~]# gitlab-ctl stop sidekiq
ok: down: sidekiq: 0s, normally up
[root@iZ2ze2jlupmjlwwfuyg30gZ ~]# gitlab-ctl stop nginx
ok: down: nginx: 1s, normally up
[root@iZ2ze2jlupmjlwwfuyg30gZ ~]# rpm -Uvh gitlab-ce-12.0.9-ce.0.el7.x86_64.rpm
warning: gitlab-ce-12.0.9-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
Preparing...                          ################################# [100%]
gitlab preinstall: It seems you are upgrading from 11.x version series
gitlab preinstall: to 12.x series. It is recommended to upgrade
gitlab preinstall: to the last minor version in a major version series first before
gitlab preinstall: jumping to the next major version.
gitlab preinstall: Please follow the upgrade documentation at https://docs.gitlab.com/ee/policy/maintenance.html#upgrade-recommendations
gitlab preinstall: and upgrade to 11.11 first.
error: %pre(gitlab-ce-12.0.9-ce.0.el7.x86_64) scriptlet failed, exit status 1
error: gitlab-ce-12.0.9-ce.0.el7.x86_64: install failed
error: gitlab-ce-11.9.9-ce.0.el7.x86_64: erase skipped
[root@iZ2ze2jlupmjlwwfuyg30gZ ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.0.0-ce.0.el7.x86_64.rpm
[root@iZ2ze2jlupmjlwwfuyg30gZ ~]# rpm -Uvh gitlab-ce-12.0.0-ce.0.el7.x86_64.rpm
[root@iZ2ze2jlupmjlwwfuyg30gZ ~]# rpm -Uvh gitlab-ce-12.0.9-ce.0.el7.x86_64.rpm
  • 升级时,不能选择跨版本太多的版本号,不然会升级失败。
[root@iZ2ze2jlupmjlwwfuyg30gZ ~]# cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
12.0.9

 

继续阅读
  • 我的QQ
  • QQ扫一扫
  • weinxin
  • 我的头条
  • 头条扫一扫
  • weinxin
IT
  • 本文由 发表于 2020年6月30日15:55:57
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
GitLab配置钉钉 GitLab-install

GitLab配置钉钉

在项目中创建Webhooks 在钉钉群创建机器人 复制access_token到gitlab中 推送代码到仓库测试 MacBook-Pro:~ lucky$ cd gitlab/ MacBook-Pr...
GitLab设置成中文 GitLab-install

GitLab设置成中文

简述 GitLab12以上的版本自带中文语言,不再需要各种翻译或者破解插件了。 配置 选择settings 选择Preferences 往下拉,选择Localization---选择中文----保存即...