[英]Prevent build of branch if another branch is not stable in jenkins multibranch pipeline
We use the gitflow branch strategy to maintain our repositories. 我们使用gitflow分支策略来维护我们的存储库。 This is linked to a multibranch pipeline in jenkins.
这与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. 我想知道是否有可能在另一个分支(例如开发)失败的情况下阻止构建master分支。
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.
因此,如果开发失败,我们最好不要构建和部署master。
Instead of preventing a build on master, you shouldn't be merging. 除了防止在master上构建之外,您不应该合并。 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. 即使是合并,您也可以合并到新的“合并分支”(取自master)中,并处理任何冲突/问题,在此基础上测试构建,只有成功之后,才会进行实际合并到master 。
Hope this helps. 希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.