繁体   English   中英

在Jenkins中配置GitLab存储库

[英]Configure GitLab repository in Jenkins

我正在尝试配置Jenkins(在Windows Server 2008上运行)连接到GitLab 6.0存储库(在Linux机器上)。

从我的本地Windows框中,我可以使用SSH URL克隆我的GitLab服务器上的项目。 我在使用HTTP URL时遇到了一些问题 ,但我确实设法使用Eclipse插件使用HTTP进行身份验证。

无法连接到存储库:

命令“d:\\ tools \\ Git \\ bin \\ git.exe ls-remote -h http://myserver.domain/mygroup/myproject.git HEAD”

返回状态码128:

stdout:stderr:错误:访问时请求的URL返回错误:504

HTTP://myserver.domain/mygroup/myproject.git/info/refs服务=混帐上传包

致命:HTTP请求失败

当我在浏览器中尝试此URL时,我会获得一个身份验证弹出窗口。 如果我输入我的电子邮件和密码,我可以成功下载分支和标签列表。

...不:

http:// username:password@myserver.domain/mygroup/myproject.git/info/refs无效:这是一个git存储库吗?

  • Windows GUI在使用SSH时没有任何问题。
    ......詹金斯似乎并不喜欢那么多:

    git@myserver.domain:MYGROUP / myproject.git

    错误“请输入Git存储库”仍然存在,当我尝试保存配置时,我看到以下堆栈跟踪:

     Exception: java.lang.RuntimeException: Failed to instantiate class hudson.plugins.git.GitSCM from {"value":"2", "userRemoteConfigs": {"url":"git@myserver.domain: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://git@myserver.domain:MYGROUP / myproject.git

詹金斯立即做出反应:

stderr:ssh:myserver.domain:mygroup:没有与name关联的地址

致命:无法从远程存储库读取。

请确保您具有正确的访问权限并且存储库存在。

正如我评论的那样

也许Jenkins不支持scp语法(带' : ')试试

 ssh://git@myserver.domain/mygroup/myproject.git

正如“ .ssh config with amazon ec2 and git ”中所提到的,使用' : '通常涉及一个~/.ssh/config file ,该~/.ssh/config file将':'之前的字符串解析为服务器,用户,端口和ssh密钥。

Jenkins可能会理解更好的git@myserver.domain/mygroup/myproject.git而不是git@myserver.domain:mygroup/myproject.git

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM