2013-11-01 54 views
5

我无法让詹金斯识别我的git repo。截图如下。我被告知使用git clone https://blah/blah.git将克隆回购作为只读而不需要凭据或密钥。我想拉取代码并构建它。如何让詹金斯连接到git存储库

有趣的是,当我从命令行执行相同的命令,它的工作原理和文件从回购中被拉下来。

export GIT_SSL_NO_VERIFY=true 
git clone https://blah.com:8443/blah.git 

当我进入詹金斯URL和环境变量,它说,它无法连接到存储库。有没有人知道我可能需要做些什么才能使它起作用?在此先感谢您的帮助。

enter image description here

UPDATE /澄清:詹金斯安装是下一个服务帐户,不涉及到公司内部的任何用户。

UPDATE#2: 这里是控制台输出。我有一点消毒,所以我道歉,如果我错过了什么。

Started by user anonymous 
Building in workspace /home/hduser/.jenkins/workspace/analytics 
Fetching changes from the remote Git repository 
Fetching upstream changes from https://blah.com:8443/blah.git 
FATAL: Failed to fetch from https://blah.com:8443/blah.gitt 
hudson.plugins.git.GitException: Failed to fetch from https://blah.com:8443/blah.git 
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:612) 
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:836) 
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:861) 
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1411) 
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652) 
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) 
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:557)  
    at hudson.model.Run.execute(Run.java:1665) 
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) 
    at hudson.model.ResourceController.execute(ResourceController.java:88) 
    at hudson.model.Executor.run(Executor.java:246) 
Caused by: hudson.plugins.git.GitException: Failed to connect to https://blah.com:8443/blah.git 
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1391) 
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.fetch(CliGitAPIImpl.java:167) 
    at hudson.plugins.git.GitAPI.fetch(GitAPI.java:229) 
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:610) 
    ... 10 more 
+0

你可以发布jenkins日志吗? – Nathan

+0

通过“从命令行执行相同的命令”我假设你的意思是'curl https://blah.com:8443/proj.git'? –

+0

@Nathan当你说詹金斯日志,我假设你是指工作的建立日志? – Classified

回答

0

感谢大家的建议,意见和帮助。我认为这是一个插件问题。其他人也经历了我做过的同样的事情(original post here)。如果我从命令行运行该命令,或者如果我在Jenkins中输入命令Build> Execute shell> Command,它可以正常工作。

我有Git客户端插件= 1.4.3和Git插件1.5.0。我会等待看看是否有更新的插件修复此问题。

+0

是否尝试过[git插件主页]中提到的建议(https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin)(请参阅“疑难解答”),告诉您使用完全合格的路径为git可执行文件? – eis

+0

另外,你可以测试'-Dorg.jenkinsci.plugins.gitclient.Git.useCLI = false',就像你的建议在同一页 – eis

+0

thx中提出的那样。是的,“陷阱”没有帮助。我升级了插件,但仍然失败,但现在它是一个不同的信息。我还没有尝试你的第二评论,但我会在一秒钟内尝试。我可能会再次降级我的插件以获得与以前相同的条件。希望它工作 – Classified