Create a global after-script section

XMLWordPrintable

      This request is for allowing the creation of one single after-script section after all steps of a given Bitbucket Pipelines builds. This "global" after-script should have an effect on all steps of the build.

      Currently, the after-script section is applied by step.

      Workaround

      If users want to have the same after-script section applied to all steps, they can create an after-script block using anchors and reference it on all steps. Below is an example of the same after-script section being applied to two steps of the same build:

      definitions:
        steps: &after-script-cleanup
          after-script:
            - echo "after script has run!"
      
      image: atlassian/default-image:3
      pipelines:
        default:
          - step:
              name: 'Step 1'
              script:
                  - echo 'Step 1 has run!'
              <<: *after-script-cleanup
          - step:
              name: 'Step 2'
              script:
                - echo 'Step 2 has run!'
              <<: *after-script-cleanup
      

            Assignee:
            Unassigned
            Reporter:
            Bruno
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: