gitlab runner 的简单用法

本文介绍了在遇到GitLab CI/CD流程中出现'fatal: could not read Username for'错误时的解决方法。通过设置git全局credential.helper为store来保存用户名密码,以及注意GitLab Runner配置文件中的用户权限问题,避免使用root用户。参考链接提供更详细的解决方案。
摘要由CSDN通过智能技术生成

1.cicd 一直报fatal: could not read Username for

解决办法:

1。设置git 记录用户名密码

git config --global credential.helper store

之后再git clone 就记录了用户名密码了

2.gitlabrunner 的配置 文件 用户应该不是root

vi /etc/systemd/system/gitlab-runner.service
 
ExecStart=/usr/lib/gitlab-runner/gitlab-runner "run" "--working-directory" "/home/gitlab-runner" "--config" "/etc/gitlab-runner/config.toml" "--service" "gitlab-runner" "--syslog" "--user" "gitlab-runner"
 
改为:
 
ExecStart=/usr/lib/gitlab-runner/gitlab-runner "run" "--working-directory" "/data/gitlab-runner" "--config" "/etc/gitlab-runner/config.toml" "--service" "gitlab-runner" "--syslog" "--user" "root"
重新注册runner
gitlab-runner register
 
启动runner服务
systemctl daemon-reload
systemctl start gitlab-runner

重启的话用上面的命令

查看 list 

https://blog.csdn.net/qq_34206560/article/details/88827395

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值