简体   繁体   中英

Jenkins slave cannot clone git repo

When trying to build a job which involves connecting to a git repo the jenkins slave is unable to clone the repo.
When trying the same with the master it works. The slave is set up on an AWS EC2 Instance (Linux).
Here is a piece of the console log:

Started by user ...<br>
Running as SYSTEM<br>
Building remotely on Jenkins-Slave (Test) in workspace /home/jenkins-slave-01/workspace/TestSlave<br>
Selected Git installation does not exist. Using Default<br>
The recommended git tool is: NONE<br>
using credential d7068211-a7f3-4eef-8c5c-4ba6c23d3766<br>
Cloning the remote Git repository<br>
Cloning repository ... <br>
 git init /home/jenkins-slave-01/workspace/TestSlave # timeout=10<br>
ERROR: Error cloning remote repo 'origin'<br>
hudson.plugins.git.GitException: Could not init /home/jenkins-slave-01/workspace/TestSlave

[...] 

hudson.plugins.git.GitException: Error performing git command: git init /home/jenkins-slave-01/workspace/TestSlave

What do i have to do in order to let the slave uses git and clone the repo?
Thanks for your help.

The steps to install the Git client on the Jenkins slave, and the Git plugin on Jenkins.

  1. Check the security groups for SSH for the EC2 instance on AWS.
  2. Install the Git client on the Jenkins slave.
  3. Configure the Git client on the Jenkins slave.
  4. Install a Git plugin on Jenkins.
  5. Configure the Git plugin on Jenkins.

The solution was to install git on the EC2 instance on which the jenkins slave run. I simply forget about that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM