简体   繁体   English

无法使用git-client插件检索jenkins中的git子模块

[英]Unable to retrieve git submodule in jenkins with git-client plugin

I'm trying to have Jenkins retrieve the submodules of a repository, but I cannot get it to work. 我正在尝试让Jenkins检索存储库的子模块,但是我无法使其正常工作。 I've looked around on the internet for a solution, but most problems there center around authentication, which is not the issue in this case. 我在Internet上四处寻找解决方案,但那里的大多数问题都围绕身份验证,在这种情况下这不是问题。 From what I've been able to gather from the error message, the issue seems to be related to the way the git-client plugin handles reponses from the command-line tools. 从我从错误消息中收集到的信息来看,问题似乎与git-client插件处理命令行工具的响应的方式有关。

As we had Git for Windows version 2.6.0 installed and the Jenkins Git-client plugin 'officially' supports version 2.5.0, I also tried uninstalling version 2.6.0 and installed version 2.5.0, but that made no difference. 因为我们已经安装了Windows 2.6.0版的Git,并且Jenkins Git-client插件“正式”支持2.5.0版,所以我也尝试了卸载2.6.0版并安装了2.5.0版,但这没什么区别。

Does anyone here have any experience with this problem or a possible solution? 这里有人对这个问题或可能的解决方案有任何经验吗? The error is: 错误是:

FATAL: Command "c:\Program Files\Git\bin\git.exe submodule update" returned status code 1:
stdout: 
stderr: Cloning into 'mysubmodule'...
error: cannot spawn echo : No such file or directory
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'http://somerepo': No error
Clone of 'http://somerepo/scm/bf/mysubmodule.git' into submodule path 'mysubmodule' failed

I have experienced the very same error, with same version of Git and Jenkins Git-client plugin. 我使用相同版本的Git和Jenkins Git-client插件遇到了同样的错误。 It appears that this could be a combination of a bug and a misconfiguration of the submodule(s) in the .gitmodules file of the main repository. 看来这可能是错误和主存储库.gitmodules文件中子模块配置错误的组合。 And the error message is definitely not as helpful as it could be! 错误消息绝对没有它可能有用的!

In my case the .gitmodules file in the main repository contained the absolute url path to the submodule. 就我而言,主存储库中的.gitmodules文件包含子模块的绝对URL路径。 This caused Jenkins to not be able to authenticate properly for the submodule. 这导致Jenkins无法对该子模块进行正确的身份验证。 Changing the submodule path to be relative (../mysub.git) fixed it for me. 将子模块路径更改为相对(../mysub.git)可以为我修复此问题。

This helped me quite a lot: https://issues.jenkins-ci.org/browse/JENKINS-31244 这对我很有帮助: https : //issues.jenkins-ci.org/browse/JENKINS-31244

I hope you find this helpful. 我希望你觉得这有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM