git - Rollback Commit Upon Build/Test Failure on Jenkins -


okay, i've seen lot of these kinds of questions without answers rather warnings against it. understand why might annoying/dangerous this, , have considered these things. how team project/management set (at least now), makes lot of sense able undo commit on bitbucket when commits , jenkins detects that, pulls, , build/test fails. there plugin/way this?

its easy enough remove head commit branch however, cannot safely in jenkins job few reasons.

the first reason may not dealing single commit. depending on how jenkins configured(ex wait perioud) single jenkins job might encompass multiple commits. additionally, user may have pushed multiple commits @ once.

secondly, there no guarantee commit started jenkins still @ head when jenkins has finished executed. takes push during time jenkins executing , have attempt more complicated rebase might not possible without human intervention(especially since default cant rebase merge commit automatically).

my strong recommendation instead of trying remove commits master/develop branch consider instead embracing pattern gitlabs responsible merging master. can set multibranch pipeline job in jenkins auto builds branches , configure gitlabs prevent merging long jenkins job failing. idea create branch per task , jenkins merges master branch , builds when submit pull request. once build successful allowed merge master.

https://about.gitlab.com/2014/09/29/gitlab-flow/


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -