如何在 Bitbucket 管道的阶段步骤中放置触发器

问题描述 投票:0回答:1

在使用阶段之前,我已将触发器放在步骤内:

- step: &deployment-prod
      name: Deploy
      trigger: manual
      script:
        - echo "production deployment script"

但是,现在我需要使用阶段来部署到多个环境,并且收到以下错误:

A step within stage can't contain a manual trigger. Try defining a manual trigger on a stage.

我也尝试这样做,但没有成功:

- stage:
     name: Deploy to Production
     deployment: Production
         steps:
            - step: 
                <<: *deployment-prod
                trigger: manual

有人可以帮助我吗?拜托啦

我想在步骤内使用带有触发器的 bitbucket 管道阶段。

bitbucket bitbucket-pipelines
1个回答
0
投票

有关阶段的文档中涵盖了该信息https://support.atlassian.com/bitbucket-cloud/docs/stage-options/#Limitations

  • 一个阶段中您可以执行的最大步数为:

  • 免费计划中工作空间的 10 个步骤。

  • 标准或高级计划的工作区有 100 个步骤。

  • 不支持并行阶段。

  • 一个阶段不能包含并行步骤。

  • 阶段不能包含手动触发的步骤,但您可以将阶段配置为手动触发。

  • 阶段不能包含条件步骤,但您可以将阶段配置为有条件。

  • 不支持在阶段内禁用工件下载。

  • 步骤不能覆盖舞台上设置的任何属性。

  • 如果随后将另一个更改部署到同一环境,则无法继续部分完成的部署阶段。


要在舞台上使用手动触发器,还需要专门记录https://support.atlassian.com/bitbucket-cloud/docs/stage-options/#Trigger

如何在阶段中使用触发器的示例

pipelines:
   default:
    - stage:
        name: Linting
        steps:
          - step:
              script:
              - sh ./run-linter.sh
    - stage:
        name: Build and test
        trigger: manual
        steps:
          - step:
              name: Build app
              script:
                - sh ./build-app.sh
          - step:
              name: Run unit tests
              script:
                - sh ./run-tests.sh
© www.soinside.com 2019 - 2024. All rights reserved.