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页面获得:
https://images2015.cnblogs.com/blog/334237/201612/334237-20161215155003042-511841914.png
executor选择shell。
示例过程如下:
https://images2015.cnblogs.com/blog/334237/201612/334237-20161215160041776-133239314.png
此时查看admin area->runners页面:
https://images2015.cnblogs.com/blog/334237/201612/334237-20161215160134589-1690156898.png
上面的即是最新生成的runner。
通过edit选项可以把新生成的runner改为specific runner,只对某个project生效,效果如下:
https://images2015.cnblogs.com/blog/334237/201612/334237-20161215174208636-1717932592.png
运行pipeline的时候,可能会显示以下错误:
Cannot connect to the Docker daemon...
原因是,运行的用户为gitlab-runner用户,可以su - gitlab-runner来调试,将其加入docker所在用户组即可解决问题:
sudo usermod -aG docker gitlab-runner
查看工程build状况:
https://images2015.cnblogs.com/blog/334237/201612/334237-20161215161019886-1311681530.png
页:
[1]