简体   繁体   English

仅针对主分支触发 Bamboo 构建计划

[英]Trigger Bamboo build plan only for master branch

I have a Bamboo plan to build and then deploy my application.我有一个 Bamboo 计划来构建然后部署我的应用程序。 There's another build plan which should be triggered after the deployment of the first one.还有另一个构建计划应该在第一个部署之后触发。 This is done with the after-deployment trigger:这是通过after-deployment触发器完成的:

triggers:
  - after-deployment:
      deployment-project: My Application
      environment: Dev
  - after-deployment:
      deployment-project: My Application
      environment: QA

However, as long as the deployment happens from the master only, I would like to trigger the secondary build plan for the master branch only, too.但是,只要仅从 master 进行部署,我也想仅触发 master 分支的二级构建计划。 However, it is triggered for the feature branches as well.但是,它也会为功能分支触发。

I have tried cleaning up the main triggers block and moving the trigger into the branch-overrides , like this, but that didn't help:我已经尝试清理主triggers块并将触发器移动到branch-overrides ,就像这样,但这没有帮助:

triggers: []

branch-overrides:
  - master:
      triggers:
        - after-deployment:
            deployment-project: My Application
            environment: Dev
        - after-deployment:
            deployment-project: My Application
            environment: QA

What's the right way to let the secondary build plan be triggered for the master branch only?只为主分支触发二级构建计划的正确方法是什么?

keep your common triggers in yaml, create a manual branch through the UI, call it something like "master deploy" and apply the custom after deployment trigger on it.将常用触发器保留在 yaml 中,通过 UI 创建一个手动分支,将其称为“主部署”并在其上应用自定义部署后触发器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM