git - 带有 git 私有仓库的 Jenkins kubernetes 插件
问题描述
我正在尝试使用jenkins kubernetes 插件和Gitlab 分支源插件,以及 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
解决方案
如果我直接在项目上设置凭据,而不是依赖全局配置,它可以无缝工作。
推荐阅读
- python - 使用 Keras 获取 LSTM 网络的 Cell、Input Gate、Output Gate 和 Forget Gate 激活值
- reactjs - 如何使用 react-select 道具类型
- css - Bootstrap - 额外保证金
- selenium-webdriver - 无法在 Kendo UI 图表上通过 xpath 定位 SVG 元素
- c++ - 检查一个类是否有一个给定名称但有任何签名的方法
- boost-geometry - 提升计算距离(各种几何)
- angular - 如何编译包含角度表达式的动态 html
- python - 从列表中提取不同布局的项目
- powershell - 如何使用 PowerShell 捕获全局击键?
- javascript - 在 Google Colab html 中导入外部 JS 脚本