无法在Jenkins中设置Git拉 [英] Unable to set up Git pull in Jenkins

查看:383
本文介绍了无法在Jenkins中设置Git拉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前在Jenkins中有Subversion版本,并且正在尝试使用Windows文件系统访问来添加Git版本。



到目前为止:




  • Jenkins GIT插件已安装。

  • Jenkins和存储库位于同一台机器上,所以我们不需要ssh设置。

  • 开始一个新的Jenkins项目,并在源代码管理下点击Git



  • 我们在Repsitory URL上遇到了一个问题:

     存储库URL:file://// my_server / Repositories / My_Repo 
    无法连接到存储库:执行命令时出错:git ls-remote -h file://// my_server / Repositories / My_Repo HEAD

    为了排除故障,我创建了一个仅运行Windows命令的单独项目,并确认:


    1. 詹金斯有权查看存储库

    2. 詹金斯路径可以找到git.exe

    3. 我可以从詹金斯运行 git ls-remote file://// my_server / Repositories / My_Repo

    4. 这意味着我的URI格式正确

    有没有人知道如何解决Jenkins Git插件无法连接到存储库的错误,当Jenkins本身可以?



    谢谢。

    解决方案

    事实证明我的文件URI是正确的,我的路径变量是正确的,包括Git,Jenkins无法使用Windows路径找到它。



    我通过以下方式解决了该问题:


    1. 管理Jenkins

    2. 配置系统

    3. Git

    4. Git可执行文件路径

    然后输入C:\程序文件(x86)\Git\bin\git .exe



    希望这可以帮助未来的人!


    We currently have Subversion builds in Jenkins, and are trying to add Git builds as well, using Windows filesystem access.

    So far:

    • Jenkins GIT Plugin is installed.
    • Jenkins and the repositories are on the same machine, so we don't need ssh setup.
    • Started a new Jenkins Project, and clicked on Git under Source Code Management.

    We're hitting a snag on the Repsitory URL:

    Repository URL: file:////my_server/Repositories/My_Repo
    Failed to connect to repository : Error performing command: git ls-remote -h file:////my_server/Repositories/My_Repo HEAD
    

    To troubleshoot, I created a separate project which just runs Windows commands, and confirmed that:

    1. Jenkins has permission to see the repository
    2. The Jenkins path can find git.exe
    3. I can get output from Jenkins running git ls-remote file:////my_server/Repositories/My_Repo
    4. Which means my URI format is correct

    Does anyone know how to fix the error with the Jenkins Git plugin not being able to connect to the repository, when Jenkins itself can?

    Thank you.

    解决方案

    It turns out my file URI was correct, and even though my path variables were correct and included Git, Jenkins was unable to find it using the Windows path.

    I resolve the problem by going to:

    1. Manage Jenkins
    2. Configure System
    3. Git
    4. Path to Git executable

    And entering C:\Program Files (x86)\Git\bin\git.exe

    Hope this helps someone in the future!

    这篇关于无法在Jenkins中设置Git拉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆