美文网首页
GitLab CI服务器的搭建

GitLab CI服务器的搭建

作者: gukwa | 来源:发表于2019-05-23 14:59 被阅读0次

1.安装Docker

参考 https://docs.docker.com/install/linux/docker-ce/centos/

2.安装gitlab ci runner

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

查看是否运行正常

gitlab-ci-multi-runner status
image.png

3.gitlab-runner注册问题

首先登陆gitlab获取url和tocken


image.png image.png
[root@gitlab-ci ~]# gitlab-ci-multi-runner register
Running in system-mode.                            
                                                   
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
https://gitlab.example.com/
Please enter the gitlab-ci token for this runner:
AvpQDzBCL66sYKyURChH
Please enter the gitlab-ci description for this runner:
[gitlab-ci]: 
Please enter the gitlab-ci tags for this runner (comma separated):
test,demo
Whether to run untagged builds [true/false]:
[false]: 
Whether to lock Runner to current project [true/false]:
[false]: 
ERROR: Registering runner... failed                 runner=AvpQDzBC status=couldn't execute POST against https://gitlab.example.com/api/v4/runners: Post https://gitlab.example.com/api/v4/runners: x509: certificate signed by unknown authority
PANIC: Failed to register this runner. Perhaps you are having network problems 
[root@gitlab-ci ~]#

证书签名错误,在网上找了许多办法还是不行,解决办法:

[root@gitlab-ci docker]# gitlab-runner register \
   --non-interactive \
   --tls-ca-file=/etc/gitlab/ssl/gitlab.example.com.crt  \
   --url "https://gitlab.example.com/" \
   --registration-token "AvpQDzBCL66sYKyURChH" \
   --executor "docker" \
   --docker-image maven:latest \
   --description "runner " \
   --tag-list "run" \
   --run-untagged \
   --locked="false"
Running in system-mode.                            
                                                   
Registering runner... succeeded                     runner=AvpQDzBC
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded! 

注册成功,返回到gitlab已经是激活的状态。


image.png

注册问题参考
https://blog.csdn.net/qq_34206560/article/details/88802893
https://docs.gitlab.com/11.9/runner/register/index.html

相关文章

网友评论

      本文标题:GitLab CI服务器的搭建

      本文链接:https://www.haomeiwen.com/subject/wmqvzqtx.html