首页 > 解决方案 > 詹金斯奴隶无法克隆 git repo

问题描述

当尝试构建一个涉及连接到 git repo 的作业时,jenkins slave 无法克隆 repo。
当尝试与主人相同时,它可以工作。从站设置在 AWS EC2 实例 (Linux) 上。
这是控制台日志的一部分:

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

为了让奴隶使用 git 并克隆 repo,我需要做什么?
谢谢你的帮助。

标签: gitjenkinsamazon-ec2

解决方案


解决方案是在运行 jenkins slave 的 EC2 实例上安装 git。我只是忘记了这一点。


推荐阅读