【发布时间】:2021-11-01 19:26:45
【问题描述】:
我正在尝试使用 jenkins kubernetes plugin 和 Gitlab branch source plugin,以及 Kubernetes 集群在我的集群中进行构建。 我成功地使管道与公共存储库一起工作,但是当我尝试在我的 SCM 中使用私有存储库时,代理 pod(使用默认的 jnlp 容器)无法针对我的 git 服务器进行身份验证。如何将凭据从 Jenkins 控制器传递到代理 pod?
管道日志:
The recommended git tool is: git
Warning: CredentialId "b4f86bce-18c3-4758-972d-5907e601efd0" could not be found.
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
Cloning repository https://gitlab.mycompany.eu/myuser/myproject.git
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --no-tags --force --progress -- https://gitlab.mycompany.eu/myuser/myproject.git +refs/heads/feature-jenkins-deployment:refs/remotes/origin/feature-jenkins-deployment" returned status code 128:
stdout:
stderr: remote: HTTP Basic: Access denied
【问题讨论】: