简体   繁体   English

Runner无法克隆gitlab存储库

[英]Runner cannot clone gitlab repository

The runner installed on my machine cannot clone the git repository. 安装在我计算机上的运行程序无法克隆git存储库。

I have a gitlab instance that runs as dockerized and expose the access to the web interface at http://172.19.193.16:666 address. 我有一个gitlab实例,以dockerized运行,并公开了对Web界面的访问权限,网址为http://172.19.193.16:666地址。 At port 80 runs another completely different web page. 在端口80处运行另一个完全不同的网页。

Gitlab suggest to clone the code with this url http://c87aa950bc8a/yamil.ortega/aprendizajegit.git but I changed to http://172.19.193.16:666/yamil.ortega/aprendizajegit.git and can do it. Gitlab建议使用此URL http://c87aa950bc8a/yamil.ortega/aprendizajegit.git克隆代码,但我改为http://172.19.193.16:666/yamil.ortega/aprendizajegit.git并可以做到这一点。

Shared runners are disable, and I registered this only runner. 共享的运行程序已禁用,我只注册了此运行程序。

在此处输入图片说明

I register and installed the runner in another computer trying to make a simple CI pipeline. 我在其他计算机上注册并安装了运行程序,以尝试建立简单的CI管道。 My toml file looks like this. 我的toml文件看起来像这样。

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "RunnerParaDotNet"
  url = "http://http://172.19.193.16:666/"
  token = "JTJxZ_xcxnzbs89Vcq_x"
  executor = "shell"
  shell = "powershell"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
  [runners.custom]
    run_exec = ""

When I add a new pipeline and the runner runs, I got the following message 当我添加新管道并且运行程序运行时,我收到以下消息

Running with gitlab-runner 12.1.0 (de7731dd)
  on RunnerParaDotNet JTJxZ_xc
Using Shell executor...
Running on CTISMXL8310VN7...
Fetching changes...
Reinitialized existing Git repository in C:/GitLab-Runner/builds/JTJxZ_xc/0/yamil.ortega/aprendizajegit/.git/
fatal: unable to access 'http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@c87aa950bc8a/yamil.ortega/aprendizajegit.git/': Could not resolve host: c87aa950bc8a
ERROR: Job failed: exit status 1

I added the line 我加了线

172.19.193.16        c87aa950bc8a

to my hosts file inside C:\\Windows\\System32\\drivers\\etc and now I got this error. 到C:\\ Windows \\ System32 \\ drivers \\ etc中的主机文件,现在出现此错误。

Running with gitlab-runner 12.1.0 (de7731dd)
  on RunnerParaDotNet JTJxZ_xc
Using Shell executor...
Running on CTISMXL8310VN7...
Fetching changes...
Reinitialized existing Git repository in C:/GitLab-Runner/builds/JTJxZ_xc/0/yamil.ortega/aprendizajegit/.git/
fatal: repository 'http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@c87aa950bc8a/yamil.ortega/aprendizajegit.git/' not found
ERROR: Job failed: exit status 1

So, I know that I can contact the Gitlab server (modifing the host file) with alias c87aa950bc8a but since it´s on port 666 , the runner cannot clone. 因此,我知道我可以使用别名c87aa950bc8a与Gitlab服务器联系(修改主机文件),但是由于它位于端口666上,因此运行程序无法克隆。 Can I try something else? 我可以尝试其他吗?

Finally found the solution. 终于找到了解决方案。 Reading about advanced runners configuration in this page https://docs.gitlab.com/runner/configuration/advanced-configuration.html 在此页面上阅读有关高级跑步者配置的信息https://docs.gitlab.com/runner/configuration/advanced-configuration.html

found that I must add the 发现我必须添加

clone_url 

instruction to the config.toml file config.toml文件的说明

So, mi config.toml file looks like this 所以,mi config.toml文件看起来像这样

concurrent = 1
check_interval = 0

[session_server]
session_timeout = 1800

[[runners]]
  name = "RunnerParaDotNet"
  url = "http://172.19.193.16:666/"
  token = "JTJxZ_xcxnzbs89Vcq_x"
  executor = "shell"
  shell = "powershell"
  clone_url = "http://172.19.193.16:666/"
[runners.custom_build_dir]
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
[runners.custom]
run_exec = ""

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM