我试图配置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 - 你能否提交这个答案? –