Home > Enterprise >  wrapper for git, for jenkins pipeline, on windows 10 jenkins slave
wrapper for git, for jenkins pipeline, on windows 10 jenkins slave

Time:01-05

What I am trying to accomplish - I want to have a wrapper for git itself, that will retry if the git command fails (timeout/network issue).

I have following dummy code of wrapper:

"C:\Program Files\Git\cmd\git.exe" %*
echo Success!

After changing $PATH and saving the file as git.cmd and removing path to git.exe it works well if I call any git command directly from jenkins:

script {
        bat 'git clone %REPO%'
       }

result:

(...)
Updating files: 100% (5314/5314), done.
17:58:51 E:\jenkins\workspace\sandbox>echo Success! 
17:58:51 Success!

However I want it to work for multibranch pipeline, which uses jenkins git plugin Node properties

  •  Tags:  
  • Related