bitbucket-pipelines.yml应该放在开发和主分支的哪里?

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

我有一个开发项目和一个主分支。我将bitbucket-pipeline.yml推送到master分支,并意识到要在developer分支上运行我的管道。最好先在开发分支上提交它吗?

bitbucket-pipelines
1个回答
0
投票

如果分支中有bitbucket-pipelines.yml,则在向该分支提交内容时,该文件将用于管道;如果创建PR,则将使用第一个分支中的文件(与提交相同)。

[最佳实践是在每个分支中都有一个文件,该文件的配置共享所有分支/标记/拉取请求的逻辑,如果您需要不同的分支规则,只需在bitbucket-pipelines.yml中指定它们。

我在每个分支中都有此文件:

image: satantime/puppeteer-node:12.16.1-buster

pipelines:
    default:
        - step: &Preparation
        - step: &Manual
        - step: &BuildAOT
        - step: &Lint
        - step: &CodeStyle
        - step: &LintTs
        - step: &LintCss
        - step: &UT
        - step: &E2E
        - step: &BuildDocker
    pull-requests:
        '**':
            - step: *Preparation
            - step: *Manual
            - parallel:
                  - step: *CodeStyle
                  - step: *Lint
            - step: *BuildAOT
            - parallel:
                  - step: *UT
                  - step: *E2E
            - step: *BuildDocker
    branches:
        '**':
            - step: *Preparation
            - step: *BuildDocker
        'master':
            - step: *Preparation
            - step: *UT
            - step: *E2E
            - step: *BuildDocker
© www.soinside.com 2019 - 2024. All rights reserved.