3

我想在我自己的 gitlab ci 服务器之外的另一台服务器上执行 gitlab-runner。我想这样做以使用另一台服务器的环境,并执行我的代码。我试图在此服务器上复制并执行二进制“gitlab-runner”,经过一些问题,我遇到了证书错误,但证书已正确安装在我的 gitlab 服务器上!

首先,这是在另一台服务器上执行跑步者的正确方法吗?

其次,我该如何解决这个证书错误?

gitlab-runner --debug register
Runtime platform  arch=amd64 os=linux revision=adfc387 version=9.2.0
Checking runtime mode  GOOS=linux uid=1125
WARNING: Running in user-mode.
WARNING: The user-mode requires you to manually start builds processing:
WARNING: $ gitlab-runner run
WARNING: Use sudo for system-mode:
WARNING: $ sudo gitlab-runner...

Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
https://mygitlab.myserver.fr/
Please enter the gitlab-ci token for this runner:
iYwQbJ-b2qg2JLu4sqn8
Please enter the gitlab-ci description for this runner:
[server1]: runnertest
Please enter the gitlab-ci tags for this runner (comma separated):

Whether to lock Runner to current project [true/false]:
[false]:
Dialing: tcp mygitlab.myserver.fr:443 ...
ERROR: Registering runner... failed                 runner=iYwQbJ-b 
status=couldn't execute POST against 
https://mygitlab.myserver.fr/api/v4/runners: Post 
https://mygitlab.myserver.fr/api/v4/runners: x509: certificate signed by 
unknown authority
Dialing: tcp mygitlab.myserver.fr:443 ...
ERROR: Checking GitLab compatibility... not-compatible  reason=GitLab Runner 
>= 9.0 can be used ONLY with GitLab CE/EE >= 9.0 result=-1 runner=iYwQbJ-b 
statusText=couldn't execute POST against 
https://mygitlab.myserver.fr/api/v4/runners/verify: Post 
https://mygitlab.myserver.fr/api/v4/runners/verify: x509: certificate signed 
by unknown authority
PANIC: Failed to register this runner. Perhaps you are having network problems

当我卷曲网址时,我收到:

curl -X POST -k --form "token=iYwQbJ-b2qg2JLu4sqn8" https://mygitlab.myserver.fr/api/v4/runners/verify
{"message":"403 Forbidden"}

非常感谢 !

4

1 回答 1

1

只需将其安装为常规 Gitlab CI 运行程序并使用 shell 执行程序。在注册运行器时添加标签,以便您可以将其用于需要此运行器的管道的特定作业。

于 2017-11-17T14:04:34.593 回答