无法使用git-client插件在jenkins中检索git子模块 [英] Unable to retrieve git submodule in jenkins with git-client plugin

查看:729
本文介绍了无法使用git-client插件在jenkins中检索git子模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让詹金斯检索一个存储库的子模块,但我无法让它工作。我在互联网上浏览过一个解决方案,但是大多数问题都以认证为中心,在这种情况下这不是问题。从我能从错误信息中收集到的信息,这个问题似乎与git-client插件处理来自命令行工具的响应的方式有关。



因为我们安装了Git for Windows 2.6.0版本,并且Jenkins Git-client插件'正式'支持2.5.0版本,所以我也尝试卸载2.6.0版本和安装2.5.0版本,但这并没有什么区别。

有没有人对这个问题有任何经验或可能的解决方案?
错误是:

  FATAL:Commandc:\ Program Files \Git\bin\ git.exe子模块更新返回状态码1:
stdout:
stderr:克隆到'mysubmodule'...
错误:不能产生回声:没有这样的文件或目录
bash:/ dev / tty:没有这样的设备或地址
错误:无法执行提示脚本(退出代码1)
致命:无法读取用户名'http:// somerepo':无错误
将'http://somerepo/scm/bf/mysubmodule.git'克隆到子模块路径'mysubmodule'失败


解决方案

我经历过与Git和Jenkins Git-client插件版本相同的错误。
看起来,这可能是主存储库的.gitmodules文件中的子模块的错误和错误配置的组合。并且错误信息肯定不如它有用!



在我的情况下,主存储库中的.gitmodules文件包含子模块的绝对url路径。这导致Jenkins无法正确验证子模块。将子模块路径更改为相对(../mysub.git)为我解决了这个问题。



这对我有很大的帮助:
https://issues.jenkins-ci.org/browse/JENKINS-31244



我希望你觉得这有帮助。


I'm trying to have Jenkins retrieve the submodules of a repository, but I cannot get it to work. 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. 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.

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.

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. 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. 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. This caused Jenkins to not be able to authenticate properly for the submodule. Changing the submodule path to be relative (../mysub.git) fixed it for me.

This helped me quite a lot: https://issues.jenkins-ci.org/browse/JENKINS-31244

I hope you find this helpful.

这篇关于无法使用git-client插件在jenkins中检索git子模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆