0
votes

We use the gitflow branch strategy to maintain our repositories. This is linked to a multibranch pipeline in jenkins. That all works just fine.

Im wondering if it's possible to prevent building the master branch if another branch, let's say develop, has failed.

Usually we merge all code into develop, then into master for deploy. So if develop is failing, we'd prefer not to build and deploy master.

1

1 Answers

0
votes

Instead of preventing a build on master, you shouldn't be merging. Only merge to master if your build on develop was successful and passed all tests.

Even when it comes the the merge - you can merge in a new 'merge branch' (taken from master) and deal with any conflicts/issues, test the build on that, and only if that succeeds does the actual merge to master take place.

Hope this helps.