我現在試圖設置一個Jenkins作業(在一臺Windows服務器上)來監視位於Gitosis服務器(位於不同Windows服務器上)的內部Git倉庫。爲什麼Jenkins的Git插件會用額外的斜槓重寫我的本地git倉庫?
url看起來像這樣:ssh://[email protected]:relative_path/repo.git(實際值替換爲安全性,相對路徑也不會與'〜/'一起使用,它只是沒有領先的'/')。
從命令行使用url運行git clone時,一切都很好。
當在Jenkins作業中配置Git SCM時,它能夠運行ls-remote命令(這證實ssh密鑰已針對Jenkins實例正確配置)。
但是,當作業執行時,url似乎被一個額外的正斜槓重寫,導致clone命令失敗。
Started by user Meh
[EnvInject] - Loading node environment variables.
Building in workspace D:\local_repo_test
> git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git.exe config remote.origin.url ssh:///[email protected]:relative_path/repo.git # timeout=10
Fetching upstream changes from ssh:///[email protected]:relative_path/repo.git
> git.exe --version # timeout=10
> git.exe -c core.askpass=true fetch --tags --progress ssh:///[email protected]:relative_path/repo.git +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo 'origin'
ERROR: Error fetching remote repo 'origin'
Finished: FAILURE
這是困擾我的'///'。有沒有人看過類似的東西?
任何幫助,將不勝感激。
我在最新的Jenkins版本中遇到同樣的錯誤,當它試圖從Gerrit內部repo配置克隆時 – daniilyar
我通過更新Jenkins作業來使用「HEAD:refs/heads/master」作爲refspec – daniilyar