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

时间:2020-07-06 22:15:41

标签: git dns gitlab-ci gitlab-ci-runner

我刚刚在我的虚拟机上安装了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

我的.gitlab-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地址? 您能帮我解决我的问题吗?

2 个答案:

答案 0 :(得分:0)

  • 这不是DNS,DNS错误会显示警告,例如NXDOMAIN或“找不到域” 更新:下次请提及您的gitlab实例不可公开查看
  • 打开https://gitlab.dev.pl/-> 没有GITLAB实例时,证书也是无效的(无论如何这都会阻止您签出)
  • Gitlab在未经授权时也会返回“未找到”,因此使用SSH密钥或获取令牌,然后使用URL https:// username:token@gitlab.some.org: 4443 /用户名/仓库名称/
  • 在任何情况下
  • 在您的gitlab实例上更好地部署https

答案 1 :(得分:0)

感谢文档benji-over-9000-benchonaut,前提是我能够解决此问题。

我需要在/etc/gitlab-runner/config.toml中添加一行

clone_ulr = "http//192.168.0.32/"