【问题标题】:Jenkins slave cannot clone git repo詹金斯奴隶无法克隆 git repo
【发布时间】:2020-11-18 21:48:30
【问题描述】:

当尝试构建一个涉及连接到 git repo 的作业时,jenkins slave 无法克隆 回购。
当尝试与主人相同时,它可以工作。从站设置在 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,我需要做什么?
谢谢你的帮助。

【问题讨论】:

  • 您确定您的实例有互联网接入,路由到互联网网关或nat网关
  • jenkins worker 上好像没有安装 git
  • 看起来它甚至没有克隆,它卡在“git init”。检查该操作是否顺利

标签: git jenkins amazon-ec2


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    在 Jenkins 从站上安装 Git 客户端的步骤,以及在 Jenkins 上安装 Git 插件的步骤。

    1. 检查 AWS 上 EC2 实例的 SSH 安全组。
    2. 在 Jenkins 从站上安装 Git 客户端。
    3. 在 Jenkins 从站上配置 Git 客户端。
    4. 在 Jenkins 上安装 Git 插件。
    5. 在 Jenkins 上配置 Git 插件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-03
      • 2018-11-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多