Gitlab runner - 致命:未找到存储库 'http://gitlab.dev.pl/user/repo-name.git/'

Gitlab runner - fatal: repository 'http://gitlab.dev.pl/user/repo-name.git/' not found

我刚刚在我的虚拟机上安装了 ubuntu 服务器 18.04 并设置了 Gitlab。我的 DNS 有问题,我使用 IP 地址连接到它。

我对 GitLab CI Runner 有问题 -> 我有错误 fatal: repository 'http://gitlab.dev.pl/user/repo-name.git/' not found

我从服务器和服务器外部克隆和推送到 git 没有问题。

整个作业日志:

 Running with gitlab-runner 13.1.1 (6fbc7474)
  on things-keeper-runner _VcemHSn
Preparing the "docker" executor
Using Docker executor with image mcr.microsoft.com/dotnet/core/sdk:3.1 ...
Pulling docker image mcr.microsoft.com/dotnet/core/sdk:3.1 ...
Using docker image sha256:006ded9ddf293ffe62ff192776bcb783199ca608405983cf53e2ea8099d3d786 for mcr.microsoft.com/dotnet/core/sdk:3.1 ...
Preparing environment
00:02
Running on runner-vcemhsn-project-1-concurrent-0 via dev_server...
Getting source from Git repository
00:02
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /builds/user/repo-name/.git/
fatal: repository 'http://gitlab.dev.pl/user/repo-name.git/' not found
ERROR: Job failed: exit code 1

我的.git实验室-ci.yml

image: mcr.microsoft.com/dotnet/core/sdk:3.1

stages:
    - build
    - test

before_script:
    - "cd src"
    - "dotnet restore"

build:
    stage: build
    script:
        - "dotnet build"

test:
    stage: test
    script: 
        - "cd .."
        - "dotnet test"

可能是 runner 无法正确解析 git.dev.pl。我可以以某种方式检查它或传递 ip 地址吗? 你能帮我解决我的问题吗?

  • 这不是 DNS,DNS 错误会显示 NXDOMAIN 或“找不到域”之类的警告 更新:下次请提及您的gitlab实例不公开可见
  • 当您打开 https://gitlab.dev.pl/ -> THERE IS NO GITLAB INSTANCE 时,证书也是无效的(无论如何都会阻止您签出)
  • Gitlab returns 当您未被授权时也会“找不到”,因此 使用 SSH 密钥 或获取令牌然后使用 url https ://用户名:token@gitlab.some.org:4443/username/repo-name/
  • 任何情况下最好在你的gitlab实例上部署https

感谢文档 benji-over-9000-benchonaut 我能够解决问题。

我需要在 /etc/gitlab-runner/config.toml

中添加一行
clone_ulr = "http//192.168.0.32/"