[英]Not able to use secure credentials in Jenkins Git Plugin
I have a Jenkins pipeline in which I am using Git plugin to checkout the pipeline code from a shared library but I am facing the issues as below:我有一个 Jenkins 管道,我在其中使用 Git 插件从共享库中签出管道代码,但我面临以下问题:
fatal: unable to access ' https://%24 {TOKEN}@github.com致命:无法访问' https://%24 {TOKEN}@github.com
Moreover, I have tried using credential binding plugin with Git plugin but I am getting the below error with that此外,我尝试使用带有 Git 插件的凭证绑定插件,但我收到以下错误
fatal: could not read Username for 'https://github.xxx.com': terminal prompts disabled
PS: I dont have any such issues in my Enterprise Jenkins version(Cloudbees core), everything seems to be working as expected, I compared every configuration but not able to find anything:( PS:我的 Enterprise Jenkins 版本(Cloudbees 核心)中没有任何此类问题,一切似乎都按预期工作,我比较了每个配置但找不到任何东西:(
Thanks, Piyush谢谢,皮尤什
Sorry, I should have posted the answer.Yes I was able to resolve the issue using below:抱歉,我应该发布答案。是的,我能够使用以下方法解决问题:
In new version of Git client, the git client uses the GIT_ASKPASS method which creates a temporary script to execute when git ask for credentials during the build.在新版本的 Git 客户端中,git 客户端使用 GIT_ASKPASS 方法创建一个临时脚本以在 git 在构建期间请求凭据时执行。
By default it runs inside Jenkins workspace, which is mounted on a filesystem on 'noexec' mode.默认情况下,它在 Jenkins 工作空间内运行,该工作空间以“noexec”模式安装在文件系统上。 We updated the noexec mode to exec and remounted the filesystem on host OS using the command and took the docker restart and now we can use Jenkins credentials for git authentication without any issues.我们将 noexec 模式更新为执行并使用命令在主机操作系统上重新挂载文件系统,并重新启动 docker,现在我们可以使用 Jenkins 凭据进行 git 身份验证,而不会出现任何问题。
using mount command, check if your filesystem which Jenkins is using to run the temporary script has been mounted as noexec mode.使用 mount 命令,检查 Jenkins 用于运行临时脚本的文件系统是否已挂载为 noexec 模式。 if yes, remove and option, remount it and take the docker service restart if you were running Jenkins aa docker container.如果是,删除并选择,重新安装它并重新启动 docker 服务,如果您正在运行 Jenkins aa docker 容器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.