【问题标题】:Where should the bitbucket-pipelines.yml pushed to with a development and master branch?bitbucket-pipelines.yml 应该与开发和主分支一起推送到哪里?
【发布时间】:2020-04-14 00:10:54
【问题描述】:

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

【问题讨论】:

    标签: bitbucket-pipelines


    【解决方案1】:

    如果您在一个分支中有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:
            '**': # <- rules for all branches
                - step: *Preparation
                - step: *BuildDocker
            'master': # <- rules for the master branch
                - step: *Preparation
                - step: *UT
                - step: *E2E
                - step: *BuildDocker
    

    【讨论】:

      猜你喜欢
      • 2020-07-25
      • 2020-08-21
      • 2012-05-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多