我試圖配置Jenkins(在Windows Server 2008上運行)以連接到GitLab 6.0存儲庫(在Linux機器上)。在Jenkins中配置GitLab存儲庫
從我的本地窗口框中,我可以使用SSH URL來克隆我的GitLab服務器上的項目。我有some issues使用HTTP URL,但我確實設法使用HTTP進行連接,並使用Eclipse插件進行身份驗證。
在詹金斯項目配置屏幕,我曾嘗試:
Failed to connect to repository :
Command "d:\tools\Git\bin\git.exe ls-remote -h http://myserver.domain/mygroup/myproject.git HEAD"
returned status code 128:
stdout: stderr: error: The requested URL returned error: 504 while accessing
http://myserver.domain/mygroup/myproject.git/info/refs?service=git-upload-pack
fatal: HTTP request failed
當我嘗試在瀏覽器這個網址我得到一個驗證彈出。如果我輸入我的電子郵件&密碼,我可以成功下載分支&標籤列表。
...好了,所以我應該能夠在URL中指定的用戶名密碼&,對不對?
...都能跟得上:
http://username:[email protected]/mygroup/myproject.git/info/refs not valid: is this a git repository?
在Windows圖形用戶界面沒有使用SSH有任何麻煩。
......詹金斯似乎不喜歡那麼多,但:[email protected]:MYGROUP/myproject.git
錯誤「請輸入Git倉庫」仍然存在,當我嘗試保存配置我看到下面的堆棧跟蹤:
Exception: java.lang.RuntimeException: Failed to instantiate class hudson.plugins.git.GitSCM from {"value":"2", "userRemoteConfigs": {"url":"[email protected]:mygroup/myproject.git", "name":"origin","refspec":"" }, "branches":{"name":""}, "includedRegions":"","excludedRegions":"","excludedUsers":"", "localBranch":"","relativeTargetDir":"","reference":"", "scmName":"", "gitConfigName":"","gitConfigEmail":"", "pruneBranches":false,"skipTag":false,"clean":false,"remotePoll":false, "disableSubmodules":false,"recursiveSubmodules":false, "authorOrCommitter":false,"wipeOutWorkspace":false,"ignoreNotifyCommit":false, "useShallowClone":false,"":["","0"], "gitTool":"Default", "browser":{"stapler- class":"hudson.plugins.git.browser.FisheyeGitRepositoryBrowser"} Stacktrace: javax.servlet.ServletException: java.lang.RuntimeException: Failed to instantiate class hudson.plugins.git.GitSCM from {...} at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:725) ... Caused by: java.lang.RuntimeException: Failed to instantiate class hudson.plugins.git.GitSCM from {...} at hudson.model.Descriptor.newInstance(Descriptor.java:617) ... Caused by: java.lang.NullPointerException at hudson.scm.RepositoryBrowser.normalizeToEndWithSlash(RepositoryBrowser.java:85) at hudson.plugins.git.browser.FisheyeGitRepositoryBrowser.<init>(FisheyeGitRepositoryBrowser.java:37)
我嘗試添加了 「SSH」 協議:
SSH://[email protected]:MYGROUP/myproject.git
詹金斯馬上反應:
stderr: ssh: myserver.domain:mygroup: no address associated with name
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
也許詹金斯不支持scp語法(使用':')試試ssh://[email protected]/mygroup/myproject.git – VonC
謝謝VonC - 你能否提交這個答案? –