我的机器上安装的运行程序无法克隆 git 存储库。
我有一个以 dockerized 方式运行的 gitlab 实例,并公开对 http://172.19.193.16:666 的 Web 界面的访问权限。地址。在端口 80 运行另一个完全不同的网页。
Gitlab 建议使用此 url http://c87aa950bc8a/yamil.ortega/aprendizajegit.git 克隆代码 但我改为http://172.19.193.16:666/yamil.ortega/aprendizajegit.git并且可以做到。
共享运行者已禁用,我注册了唯一的运行者。
我在另一台计算机上注册并安装了运行器,试图创建一个简单的 CI 管道。我的 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 = ""
当我添加新管道并且运行器运行时,我收到以下消息
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
我添加了该行
172.19.193.16 c87aa950bc8a
到 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
所以,我知道我可以使用别名 c87aa950bc8a 联系 Gitlab 服务器(修改主机文件),但由于它位于端口 666 上,因此运行程序无法克隆。 我可以尝试别的吗?
最佳答案
终于找到解决办法了。 在此页面中阅读有关高级运行者配置的信息 https://docs.gitlab.com/runner/configuration/advanced-configuration.html
发现我必须添加
clone_url
config.toml 文件的说明
所以,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 = ""
关于gitlab - Runner 无法克隆 gitlab 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57188859/