Reputation: 4452
I am using RedHat Linux
BitBucket
say Demo and I have
some HTML
code into that.Jenkins
on my system.What I am trying to do is clone the BitBucket
repository with Jenkins
so that I will be able to build the project.
Steps what I am following is
Jenkins
.git
and Jenkins
ask for repository URL, and I am giving this URL.
but Jenkins
throwing an error saying:
Failed to connect to repository : Error performing command: git ls-remote -h git clone https://[email protected]/UserName/java-script.git HEAD
I spent around 3 days and could not configure this instead learned a lot about Jenkins
.
I have also tried the BitBucket
plug-in for Jenkins
that also was not working.
Upvotes: 7
Views: 22799
Reputation: 1
This is because private key is not establishing to GIT through Jenkins.
So create credentials:
It should work, try it.
Upvotes: -1
Reputation: 3201
For Jenkins 1.5 or greater( till 1.6)
The error you are getting because in the global configuration of Jenkins, the git path is not correct/or not inserted.
That's why Jenkins is unable to run the git command.
Please go to Manage Jenkins-> Configure System Settings
. Check for git section and add correct path.
Its already seems that you have removed the Git Clone from the URL provided by Bitbucket.
Update:
For Jenkins 2.0 or above
You can find this setting under Global tool configuration.
Upvotes: 8
Reputation: 10382
Remove the "git clone" keywords and it should work :)
Jenkins only need the http URL:
https://[email protected]/UserName/java-script.git
Upvotes: 0