Gitlab-CI Runner HTTP Basic Access denied with private repo (self-hosted)

Gitlab-CI Runner HTTP Basic Access denied with private repo (self-hosted)

这是我点击 show complete raw 得到的输出,因为普通视图只有 1 条黑线(里面没有日志)。

我尝试了 https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/ci/ssh_keys/README.md 所说的方法,但没有成功。

我有一个带有两个 docker 容器的服务器:一个带有 gitlab,另一个带有 gitlab-runner。我已经使用共享运行器和特定运行器进行了测试(如我在下面显示的代码)。在这两种情况下都是一样的:它失败了,因为它无法获取我的存储库。

如果我设置了我的回购 public(既不是私人的,也不是内部的),它只适用于(共享和特定的跑步者)。我想使用私人仓库。

[0KRunning with gitlab-runner 10.1.0 (c1ecf97f)
  on runner-myrepo-js (900c71a4)
[0;m[0KUsing Docker executor with image node:latest ...
[0;m[0KUsing docker image sha256:46da793b60ee30f8df451729e315f531f0acd24a92c8fba10401513530beff99 for predefined container...
[0;m[0KPulling docker image node:latest ...
[0;m[0KUsing docker image node:latest ID=sha256:cbea0ebe4f3cf07daecf22b196ba6b5d76d1fe1b6548098e5bc9dd9b0736f262 for build container...
[0;msection_start:1509656546:prepare_script
[0KRunning on runner-900c71a4-project-32-concurrent-0 via a16b07f5f84b...
section_end:1509656548:prepare_script
[0Ksection_start:1509656548:get_sources
[0K[32;1mCloning repository...[0;m
Cloning into '/builds/gitlab/myuser/myrepo-js'...
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'https://example.com/gitlab/myuser/myrepo-js.git/'
section_end:1509656549:get_sources
[0K[31;1mERROR: Job failed: exit code 1
[0;m

我该怎么办?

我在版本 10 中同时拥有 gitlab 和 gitlab-runner。

我们今天很纠结,确定是 SSL 的问题:

我们的前端使用 SSL 证书,但后端 (gitlab) 使用纯 HTTP(在代理后面)。这打破了作业的实时日志和跑步者对私人回购的访问。

在后端添加 SSL 并强制使用 HTTPS 解决了问题。