简体   繁体   中英

Jenkins Git configuration with passphrase on Windows

I am trying to create job in Jenkins (on windows) which should fetch from git and build project. So I configure git, but it doesn't work.
Steps configuration:
1. Manage Jenkins -> System configuration under the section Git -> Git installations -> Path to Git executable specified git.exe path C:\\Program Files (x86)\\Git\\cmd\\git.exe
2. Created new job

  • GitHub project: https://github.com/example/example1/ .
  • Repository URL: git@github.com:example/example1.git
  • Credentials: Added credentials with following parameters:
    Scope: Global
    Username: set git username
    Private Key: choose enter directly and set content of id_rsa file
    Advanced-> Passphrase: entered the passphrase

  • Branches to build: */first_demo

After the build console output :

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

Could you please help why it's not working ?

The git clone default timeout is 10 minutes, you can change it by adding advanced behavior when cloning with git on your Jenkins project. You can do it by using the following steps:

  1. Open your project
  2. Configure
  3. In Source Code Management > Git -> Additional Behaviors
  4. add behavior: Advanced Clone behaviors
  5. enter value on Timeout (in minutes) for clone and fetch operations for example 60 minutes (default is 10 minutes).

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