在Windows上使用密码短语的Jenkins Git配置

时间:2015-02-10 12:02:22

标签: windows git github jenkins

我正在尝试在Jenkins(在Windows上)创建作业,这应该从git和构建项目中获取。所以我配置git,但它不起作用。
步骤配置:
1。管理Jenkins - > Git部分下的系统配置 - >     Git安装 - > Git可执行文件的路径指定git.exe路径C:\ Program Files(x86)\ Git \ cmd \ git.exe
2. 创建新职位

  • GitHub项目:https://github.com/example/example1/
  • 存储库URL:git@github.com:example / example1.git
  • 凭据:添加了包含以下参数的凭据:  
    范围:全球  
    用户名:设置git用户名
     私钥:直接选择回车并设置id_rsa文件的内容  
    高级 - >密码短语:输入密码短语

  • 要构建的分支:* / first_demo

构建控制台输出后:

Building in workspace D:\jenkins_workspace
 C:\Program Files (x86)\Git\cmd\git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 C:\Program Files (x86)\Git\cmd\git.exe config remote.origin.url git@github.com:example/example.git # timeout=10
Fetching upstream changes from git@github.com:example/example1.git
C:\Program Files (x86)\Git\cmd\git.exe --version # timeout=10
using GIT_SSH to set credentials 
C:\Program Files (x86)\Git\cmd\git.exe -c core.askpass=true fetch --tags --progress git@ssh.github.com:example/example1.git +refs/heads/*:refs/remotes/origin/*
ERROR: Timeout after 10 minutes
ERROR: Error fetching remote repo 'origin'
ERROR: Error fetching remote repo 'origin'
Finished: FAILURE

你能帮忙解释它为什么不工作吗?

1 个答案:

答案 0 :(得分:1)

git clone默认超时为10分钟,您可以通过在Jenkins项目上使用git进行克隆时添加高级行为来更改它。 您可以使用以下步骤来完成此操作:

  1. 打开您的项目
  2. 配置
  3. 源代码管理> Git - > 其他行为
  4. 添加行为:高级克隆行为
  5. 克隆和获取操作的超时(以分钟为单位)中输入值,例如60分钟(默认为10分钟)。