2015-10-05 121 views
0

我試圖讓Jenkins檢索存儲庫的子模塊,但是我無法使其工作。我在互聯網上瀏覽過一個解決方案,但是大多數問題都以認證爲中心,在這種情況下這不是問題。從我能從錯誤信息中收集到的信息,這個問題似乎與git-client插件處理來自命令行工具的響應的方式有關。無法使用git-client插件在jenkins中檢索git submodule

由於我們安裝了Git for Windows 2.6.0,並且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 

回答

1

我已經經歷了同樣的錯誤,同版本Git和詹金斯Git的客戶端插件。 看來,這可能是主存儲庫的.gitmodules文件中的子模塊的錯誤和錯誤配置的組合。並且錯誤信息絕對不如它可能的有用!

在我的情況下,主存儲庫中的.gitmodules文件包含子模塊的絕對url路徑。這導致Jenkins無法正確驗證子模塊。將子模塊路徑更改爲相對(../mysub.git)爲我解決了這個問題。

這幫助我不少: https://issues.jenkins-ci.org/browse/JENKINS-31244

我希望對您有所幫助。