Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins fails with github "git clone"

Tags:

When I do build in Jenkins, it fails with this error. Any idea?

ERROR: Error cloning remote repo 'origin' : Could not clone [email protected]:test/test.git ERROR: Cause: Error performing command: git clone --progress -o origin   [email protected]:test/test.git /var/lib/jenkins/jobs/test/workspace Command "git clone --progress -o origin [email protected]:test/test.git  /var/lib/jenkins/jobs/test/workspace" returned status code 128: Initialized empty Git  repository in /var/lib/jenkins/jobs/test/workspace/.git/  No protocol specified  (ssh-askpass:801): Gtk-WARNING **: cannot open display: :0.0 Host key verification failed. fatal: The remote end hung up unexpectedly 
like image 223
Sam Avatar asked May 23 '11 22:05

Sam


People also ask

Is it possible to clone a Git repository in Jenkins?

There are two ways to clone the project(repository) from Github. Create a new Jenkins job called 'Clone-with-https', move to the “Source Control Management” setting, and choose “Git” options if you cannot see the Git options that mean the 'GitHub' plugin wasn't installed in the Jenkins machine.

Can you use Jenkins with GitHub?

Can You Use Jenkins With GitHub? You can and should use Jenkins with GitHub to save time and keep your project up-to-date. One of the basic steps of implementing CI/CD is integrating your SCM (Source Control Management) tool with your CI tool. This saves you time and keeps your project updated all the time.

How do I link my GitHub repository to Jenkins?

Scroll down a bit more and you'll see the Pipeline section, where we'll tell Jenkins to use the GitHub repo as the source. In the Definition dropdown, choose Pipeline script from SCM to configure the repo. For the SCM dropdown, pick Git (1), and below, in the Repository URL, type (or paste) the full GitHub repo URL.


1 Answers

You need to copy your private ssh key into the .ssh folder beneath Jenkins. Something like (on Ubuntu Lucid): /var/lib/jenkins/.ssh

like image 145
Hedgehog Avatar answered Sep 21 '22 05:09

Hedgehog