问题
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:
- Jenkins has permission to see the repository
- The Jenkins path can find git.exe
- I can get output from Jenkins running
git ls-remote file:////my_server/Repositories/My_Repo
- 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.
回答1:
Well that would be because that's not a valid Git URI. You need to link to the C:\ or whatever drive letter path, not to a file:// url. Also, two slashes, not three.
回答2:
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:
- Manage Jenkins
- Configure System
- Git
- Path to Git executable
And entering C:\Program Files (x86)\Git\bin\git.exe
Hope this helps someone in the future!
来源:https://stackoverflow.com/questions/21565569/unable-to-set-up-git-pull-in-jenkins