【问题标题】:Jenkins kubernetes plugin with git private repo带有 git 私有仓库的 Jenkins kubernetes 插件
【发布时间】: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

【问题讨论】:

标签: git github jenkins gitlab


【解决方案1】:

如果我直接在项目上设置凭据,而不是依赖全局配置,它可以无缝运行。

【讨论】:

    猜你喜欢
    • 2022-08-20
    • 2018-04-29
    • 2018-06-16
    • 2019-02-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-27
    • 2010-11-18
    相关资源
    最近更新 更多