如何让Jenkins连接到git存储库

如何让Jenkins连接到git存储库,git,ssh,jenkins,gitweb,Git,Ssh,Jenkins,Gitweb,我很难让詹金斯认出我的git回购。截图如下。我被告知使用git clonehttps://blah/blah.git将回购克隆为只读,不需要凭据或密钥。我只想提取代码并构建它 有趣的是,当我从命令行执行同一个命令时,它工作了,文件从repo中被拉下来 export GIT_SSL_NO_VERIFY=true git clone https://blah.com:8443/blah.git 当我在Jenkins中输入url和环境变量时,它表示无法连接到存储库。有人知道我需要做什么才能让它工作吗

我很难让詹金斯认出我的git回购。截图如下。我被告知使用git clonehttps://blah/blah.git将回购克隆为只读,不需要凭据或密钥。我只想提取代码并构建它

有趣的是,当我从命令行执行同一个命令时,它工作了,文件从repo中被拉下来

export GIT_SSL_NO_VERIFY=true
git clone https://blah.com:8443/blah.git
当我在Jenkins中输入url和环境变量时,它表示无法连接到存储库。有人知道我需要做什么才能让它工作吗?提前感谢你的帮助

更新/澄清:Jenkins安装在服务帐户下,与公司内的任何用户无关

更新#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

谢谢大家的建议、评论和帮助。我认为这是一个插件问题。其他人也经历了和我一样的事情。如果我从命令行运行这个命令,或者在Jenkins中输入Build>executeshell>command命令,它就可以正常工作


我有Git客户端插件=1.4.3和Git插件1.5.0。我会等着看是否有更新的插件可以解决这个问题。

你能发布jenkins日志吗?通过“从命令行执行相同的命令”,我想你的意思是
curlhttps://blah.com:8443/proj.git
?@Nathan当你说jenkins log时,我想你是指作业的构建日志?@MaxLeske我想jenkins运行的东西与我在命令行上运行的东西类似。我在命令行上运行的是
gitclonehttps://blah.com:8443/proj.git
我在屏幕上看到所有这些活动,几秒钟后,我的当前目录中有git repo的文件哦,请记住我是jenkins和git noob。我已经花了两天的时间试图解决这个问题,但进展甚微。您是否尝试了(请参阅“gotchas”)中提到的建议,告诉我们对git可执行文件使用完全限定路径?此外,您还可以测试
-Dorg.jenkinsci.plugins.gitclient.git.useCLI=false
,就像在同一页中建议的那样。是的,“抓住你了”没用。我升级了插件,但还是失败了,尽管现在这是另一条信息。我还没有试过你的第二条评论,但我会马上尝试。我可能会再次降级我的插件,以获得与以前相同的条件。希望它能工作。第二种方法是强制使用不同的插件,因此它应该能工作,但会导致功能减少。@eis,thx,但选项useCLI=false没有帮助。我通过tomcat(./catalina.sh-Dblah.useCLI=false start)运行了这个程序,所以我不知道这是否有区别,但当我运行ps-ef | grep catalina时,我确实看到了其中的选项,所以我想Jenkins看到了它。