IIUC you just want to use try/catch syntax. Do the rollback you want in the catch block.
HTH
Looking for thoughts on how to add rollback steps to a Jenkinsfile / pipeline when something fails.. for example, i may want to do a rollback of DB changes if a pipeline fails in a particular stage, etc. Any pointers would be appreciated!
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6b47d4a2-5648-4be4-8882-5bd2a904dc5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.