簡體   English   中英

無法使用git-client插件檢索jenkins中的git子模塊

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

我正在嘗試讓Jenkins檢索存儲庫的子模塊,但是我無法使其正常工作。 我在Internet上四處尋找解決方案,但那里的大多數問題都圍繞身份驗證,在這種情況下這不是問題。 從我從錯誤消息中收集到的信息來看,問題似乎與git-client插件處理命令行工具的響應的方式有關。

因為我們已經安裝了Windows 2.6.0版的Git,並且Jenkins Git-client插件“正式”支持2.5.0版,所以我也嘗試了卸載2.6.0版並安裝了2.5.0版,但這沒什么區別。

這里有人對這個問題或可能的解決方案有任何經驗嗎? 錯誤是:

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

我使用相同版本的Git和Jenkins Git-client插件遇到了同樣的錯誤。 看來這可能是錯誤和主存儲庫.gitmodules文件中子模塊配置錯誤的組合。 錯誤消息絕對沒有它可能有用的!

就我而言,主存儲庫中的.gitmodules文件包含子模塊的絕對URL路徑。 這導致Jenkins無法對該子模塊進行正確的身份驗證。 將子模塊路徑更改為相對(../mysub.git)可以為我修復此問題。

這對我很有幫助: https : //issues.jenkins-ci.org/browse/JENKINS-31244

我希望你覺得這有幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM