另一台服务器上的Gitlab-runner
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了另一台服务器上的Gitlab-runner相关的知识,希望对你有一定的参考价值。
我想在另一台服务器上执行gitlab-runner而不是我自己的gitlab ci服务器。我想这样做是为了使用另一台服务器的环境,并执行我的代码。我尝试在这个服务器上复制并执行二进制'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"}
非常感谢你 !
答案
只是install it as a regular Gitlab CI亚军并使用shell执行器。添加标签时registering是跑步者,因此您可以将它用于需要此跑步者的管道的特定作业。
以上是关于另一台服务器上的Gitlab-runner的主要内容,如果未能解决你的问题,请参考以下文章
Bot Emulator 连接到另一台机器上的 Node.js 服务
将 Java 应用程序从 PC 连接到另一台 PC 上的 XAMPP 服务器