Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-16422

pipeline reuse steps

    XMLWordPrintable

Details

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      So the issue is basically code duplication.

      I currently have a pipeline similar to this

      #!yaml
      
      pipelines:
          branches:
              master:
                  - parallel:
                      - step:
                          name: Test
                          image: chialab/php:7.2
                          caches:
                              - composer
                          script:
                              - composer install --no-progress --no-suggest
                              - vendor/bin/phpunit
                      - step:
                          name: Webpack
                          image: node:carbon
                          caches:
                              - node
                          script:
                              - yarn install
                              - yarn run build
                          artifacts:
                              - web/build/**
                      - step:
                          name: Composer
                          image: chialab/php:7.2
                          caches:
                              - composer
                          script:
                              - composer install --no-dev --no-progress --no-suggest --optimize-autoloader --classmap-authoritative
                          artifacts:
                              - vendor/**
                  - step:
                      name: Deploy
                      deployment: Production
                      script:
                          - rsync [...]
      

      This is for live deployment. But I would also like the test and webpack step to run on all branches. So the only way (that I know of) is to copy paste them into other branch definitions.

      I would much rather have something like this:

      #!yaml
      
      pipelines:
          default:
              - parallel:
                  - step: test
                  - step: webpack
          branches:
              master:
                  - parallel:
                      - step: test
                      - step: webpack
                      - step: composer
                  - step:
                      name: Deploy
                      deployment: Production
                      script:
                          - rsync [...]
      
      definitions:
          steps:
              test:
                  name: Test
                  image: chialab/php:7.2
                  caches:
                      - composer
                  script:
                      - composer install --no-progress --no-suggest
                      - vendor/bin/phpunit
              webpack:
                  name: Webpack
                  image: node:carbon
                  caches:
                      - node
                  script:
                      - yarn install
                      - yarn run build
                  artifacts:
                      - web/build/**
              composer:
                  name: Composer
                  image: chialab/php:7.2
                  caches:
                      - composer
                  script:
                      - composer install --no-dev --no-progress --no-suggest --optimize-autoloader --classmap-authoritative
                  artifacts:
                      - vendor/**
      
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            b96598c45c08 marco_pfeiffer
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: