gitlab-ce升级步骤
2026-01-2116.3.9 => 16.7.10 => 16.11.10 => 17.1.8 => 17.3.7 => 17.5.5 => 17.8.7 => 17.11.6
1、官方升级路径:11.3.4–>11.11.8–>12.0.12–>12.1.17–>12.10.14–>13.0.14–>13.1.14–>13.8.8–>13.12.15–>14.0.12–>14.3.6–>14.9.5–>14.10.5–>15.0.5–>15.4.6–>15.11.13–>16.3.8–>16.7.9–>16.11.10–>17.2.1--> 17.3.1-->17.11.7-->18.2.*>18.5.*-->18.8*
2、docker版本gitlab升级
docker exec -it gitlab bash
gitlab-backup create
docker ps
docker stop gitlab
docker rm gitlab
docker logs -f gitlab
3、
docker pull registry.gitlab.cn/omnibus/gitlab-jh:15.11.13
docker pull registry.gitlab.cn/omnibus/gitlab-jh:16.3.8
4、docker run
#!/bin/sh
export GITLAB_HOME=/opt/gitlab
docker run -d -v /etc/localtime:/etc/localtime --detach --hostname git.mydns.com --publish 443:443 --publish 80:80 --publish 22:22 --name gitlab --restart always --volume $GITLAB_HOME/config:/etc/gitlab --volume $GITLAB_HOME/logs:/var/log/gitlab --volume $GITLAB_HOME/data:/var/opt/gitlab --shm-size 256m registry.gitlab.cn/omnibus/gitlab-jh:${ver}
5、docker exec -it gitlab bash
gitlab-ctl status 所有进程都启动后
http://127.0.0.1访问
6、检查版本
cat /opt/gitlab/version_menifest.txt|egrep git
7、因此在gitlab-ce 15.11.13升级到16.3.8前,需要手动将postgresql版本升级到13(正常情况下,版本升级的时候postgresql是会跟着版本升级的,如果遇到没有跟着gitlab版本升级,需要手动升级)
8、yum 或者rpm安装升级
cat << EOF > /etc/yum.repo.d/gitlab-ce.repo
[gitlab_gitlab-ce]
name=gitlab_gitlab-ce
#baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/9/$basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
repo_gpgcheck=0
gpgcheck=0
enabled=1
EOF
9、rpm -qa|grep gitlab
yum -y install https://mirror.tuna.tsinghua.edu.cn/gitlab-ce/yum/el9/Packages/g/gitlab-ce-17.11.7-ce.0.el9.x86_64.rpm
yum -y install https://mirror.tuna.tsinghua.edu.cn/gitlab-ce/yum/el9/Packages/g/gitlab-ce-18.2.8-ce.0.el9.x86_64.rpm
yum -y install https://mirror.tuna.tsinghua.edu.cn/gitlab-ce/yum/el9/Packages/g/gitlab-ce-18.5.5-ce.0.el9.x86_64.rpm
10、启动
gitlab-ctl start
gitlab-ctl status