Reputation: 14554
My objective is to prevent pushing to a branch if unit test fails using Jenkins and its Github Plugin.
I saw it works in TeamCity in my previous company, and I believe it is common practice.
However, from this tutorial, the code will always be pushed to github branch even if the unit test fails, because the webhook is triggered after the git push.
How do I configure Jenkins to achieve my objective? If it is possible using Jenkins and Githb Plugin.
Upvotes: 0
Views: 129
Reputation:
jenkins won't do that for you, github might, or failing that you need a pre-commit hook.
https://git-scm.com/book/gr/v2/Customizing-Git-Git-Hooks
Upvotes: 1