简体   繁体   English

如果另一个分支在詹金斯多分支管道中不稳定,则防止分支的建立

[英]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.

相关问题 Jenkins Multibranch(管道)/分支跟踪 - Jenkins Multibranch (Pipeline) / Branch tracking 为 Jenkins 多分支管道中的每个分支设置通用构建参数 - Set common build parameters for every branch in Jenkins multibranch pipeline 如何在提交分支时触发multibranch管道构建? - How to trigger multibranch pipeline build on commit to branch? Jenkins 从另一个多分支管道构建多分支管道 - Jenkins build multibranch pipeline from another multibranch pipeline 如何使用 Jenkins 多分支管道检查同一分支上的先前构建是否已开始 &lt;3 小时或 &gt;3 小时 - How to check if the previous build on the same branch has started <3 hrs or >3 hrs using Jenkins Multibranch Pipeline jenkins 多分支管道中的分支索引会触发额外的构建,该构建已由 poll SCM 构建 - Branch Indexing in jenkins multibranch pipeline triggers extra build, which is already built by poll SCM Jenkins 管道构建分支触发器 - Jenkins pipeline build branch triger 在拉取请求 jenkins 多分支管道的情况下获取分支名称 - Get branch name in case of pull request jenkins multibranch pipeline Jenkins Scan Multibranch Pipeline停止检测开发分支 - Jenkins Scan Multibranch Pipeline stopped detecting develop branch Jenkins多分支管道具有多个具有相同分支名称的来源 - Jenkins Multibranch Pipeline with multiple sources with the same branch name
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM