【发布时间】:2019-10-04 13:24:03
【问题描述】:
我在 Carthage、GitLab CI 和我们的内部依赖项方面遇到了一些身份验证问题。 我们的跑步者很干净,出于安全原因,他们的钥匙串中没有存储 GitLab 的任何凭据。
当carthage bootstrap 在作业中运行时,Carthage 使用git credential fill 来验证请求,在我们的例子中它失败了。
A shell task (/usr/bin/env git fetch --prune --quiet https://gitlab.corp.com/path/to/lib.git refs/tags/*:refs/tags/* +refs/heads/*:refs/heads/* (launched in /Users/x/Library/Caches/org.carthage.CarthageKit/dependencies/lib)) failed with exit code 128:
remote: HTTP Basic: Access denied
remote: You must use a personal access token with 'api' scope for Git over HTTP.
remote: You can generate one at https://gitlab.corp.com/profile/personal_access_tokens
fatal: Authentication failed for 'https://gitlab.corp.com/path/to/lib.git/'
每个作业都有一个作业令牌,它应该使用它与 GitLab 进行通信。
如何临时将用户名gitlab-ci-token 和密码$CI_JOB_TOKEN 插入到 git credential-cache 存储中?
【问题讨论】:
标签: git gitlab gitlab-ci carthage