Gitlab安装
安装指定版本gitlab
gitlab安装包网址:https://packages.gitlab.com/gitlab/gitlab-ce
1.下载指定版本的gitlab安装包:
https:``//packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/bionic/gitlab-ce_12.8.7-ce.0_amd64.deb
2.安装相关依赖
apt-get install curl openssh-server ca-certificates postfix
3.安装gitlab
dpkg -i gitlab-ce_12.8.7-ce.0_amd64.deb
4.修改gitlab.rb文件,修改访问地址。
sudo vim /etc/gitlab/gitlab.rb``将external_url=``"http://gitlab.example.com"``修改为指定访问地址,例如``"http://newgitlab.com"
保存修改并退出编辑
5.启动服务
gitlab-ctl reconfigure
注:每次修改都要重启服务
sudo gitlab-ctl restart
6.修改hosts文件对应ip与网址
例如 10.8.0.15 newgitlab.com
启动和停止服务
sudo gitlab-ctl start` `sudo gitlab-ctl stop
gitlab升级 官方升级文档:https://about.gitlab.com/update/#ubuntu 查看当前gitlab版本号
yum list | grep gitlab-ce
备份文件
gitlab-rake gitlab:backup:create
配置gitlab yum源
curl -s https:``//packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
升级到最新版本
yum install -y gitlab-ce
查看当前版本
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
gitlab降级 查看当前版本号
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
停止所有服务
gitlab-ctl stop
删除当前版本
gitlab-ctl uninstall` `yum remove gitlab-ce` `gitlab-ctl cleanse` `#保留数据不执行该命令` `rm -rf /opt/gitlab` `#保留数据不执行该命令
操作安装指定版本gitlab即可