Praqma / pretested-integration-plugin

A generic pretest commit plugin for Jenkins CI
MIT License
7 stars 14 forks source link

Make push to remote more robust due to server and network issues #132

Open bicschneider opened 6 years ago

bicschneider commented 6 years ago

-- Try again... maybe up to one minute.. ( timeout like Git Plugin ) .. but detect if the push fails due to not fast-forward and fail..

At least: We should try again in this scenario:

00:04:25.805 hudson.plugins.git.GitException: Command "git push <server> HEAD:refs/heads/develop" returned status code 1:
00:04:25.805 stdout: 
00:04:25.805 stderr: remote: error: cannot lock ref 'refs/heads/develop': ref refs/heads/develop is at a3e7fe28f348d4e0c42cdae7062052d7bcca9e4b but expected f23e9d2d903ab76bb3c68a2b139e1ac5e95c14c6        

We should stop trying in this scenario:

hudson.plugins.git.GitException: Command "git push <server/remote> refs/heads/masterPipeScriptedSCM:refs/heads/masterPipeScriptedSCM" returned status code 1:
stdout: 
stderr: To <server/remote>
 ! [rejected]        masterPipeScriptedSCM -> masterPipeScriptedSCM (non-fast-forward)
error: failed to push some refs to 'git@github.com:bicschneider/test-git-phlow-plugin.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.