gitlab–基础–07–CICD–问题
1、Fetching git代码失败
1.1、问题
fatal: git fetch-pack: expected shallow list
fatal: The remote end hung up unexpectedly
1.2、解决方案
升级Git版本
https://blog.csdn.net/zhou920786312/article/details/126442919
2、将gitlab-runner的用户修改为root
2.1、问题
在运行时,遇到权限问题需要给gitlab-runner用户增加权限,这里为了方便,直接将gitlab-runner的用户修改为root。
2.2、解决方案
# 删除gitlab-runner
gitlab-runner uninstall
# 启动 gitlab-runner
gitlab-runner install --working-directory /home/gitlab-runner --user root
# 重启service服务
service gitlab-runner restart
3、给gitlab-runner的用户添加sudo权限
3.1、问题
在运行时,遇到权限问题需要给gitlab-runner用户增加权限,这里给gitlab-runner用户sudo权限,且没有密码
3.2、解决方案
vi /etc/sudoers
新增内容
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
gitlab-runner ALL=(ALL) NOPASSWD:ALL