CentOS Gitlab CI Runner配置

 参照官方文档:

https://docs.gitlab.com/runner/install/linux-repository.html

首先,下载配置yum repository信息:

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

 

然后,安装gitlab-ci-multi-runner:

sudo yum install -y gitlab-ci-multi-runner

 

最后,注册配置gitlab-ci runner:

sudo gitlab-ci-multi-runner register

 

其中,gitlab-ci token通过一下admin area页面获得:

 executor选择shell。

示例过程如下:

 

此时查看admin area->runners页面:

 

上面的即是最新生成的runner。

 

通过edit选项可以把新生成的runner改为specific runner,只对某个project生效,效果如下:

运行pipeline的时候,可能会显示以下错误:

Cannot connect to the Docker daemon...

原因是,运行的用户为gitlab-runner用户,可以su - gitlab-runner来调试,将其加入docker所在用户组即可解决问题:

sudo usermod -aG docker gitlab-runner

 

查看工程build状况:

 

转载于:https://www.cnblogs.com/flasheryu/p/6183573.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值