Bootstrap

Gitlab 安装gitlab-runner踩坑记录

Gitlab Ci 踩坑记录

一、centos7搭建gitlab -runner

1、搭建gitlab-runner

1.1 添加gitlab-runner仓库地址

curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh | sudo bash

1.2 安装gitlab-runner

sudo yum install gitlab-runner

2 遇到的bug

2.1 错误

在centos7上搭建 gitlab-runner 后,二次 构建项目 报错

Running with gitlab-runner 13.10.0 (54944146)
  on gjkj 3azXyAP9
Preparing the "shell" executor
00:00
Using Shell executor...
Preparing environment
00:00
Running on gjkj...
Getting source from Git repository
00:02
Fetching changes with git depth set to 50...
################################################
Reinitialized existing Git repository in /home/gitlab-runner/builds/3azXyAP9/0/lurious/newer/.git/
fatal: git fetch-pack: expected shallow list
fatal: The remote end hung up unexpectedly
##############################################
Cleaning up file based variables
00:00
ERROR: Job failed: exit status 1
2.2 原因

git的版本太低了,不支持最新的API

2.3 解决方案

参考 [https://www.jianshu.com/p/30b6771178cf]

升级git

#安装源
yum install http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm
#安装git
yum install git
#更新git
yum update git
;