The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

define and calling stage using yaml anchors

Prashantanu Singh Rathore (Temp)
April 14, 2023

Is it possible to define a stage under definations and call like steps. ?

 

https://support.atlassian.com/bitbucket-cloud/docs/yaml-anchors/

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 16, 2023

Hi @Prashantanu Singh Rathore (Temp),

Thank you for reaching out to the community.

Indeed, it is possible to use stages as anchors.
Here's an example way to do it as mentioned in this other community post:

definitions:
  steps:
    - step: &just-a-step
        name: Do the thing
        script:
          - echo 'Doing the thing'
  stages:
    - stage: &my-awesome-stage
        name: My awesome stage
        steps:
          - step: *just-a-step

pipelines:
  branches:
    master:
      - stage: *my-awesome-stage

Hope it helps and let me know how it goes.

Regards,
Mark C

Prashantanu Singh Rathore (Temp)
April 17, 2023

Thanks its working. I tried for paraller step exuection inside an stage. But it failed. Please verify the following config

 

stages:
   - stage: &continuous-integration-pipeline
        name: continuous-integration-pipeline
        steps:
           - step: *Install-Dependencies
            - parallel:
                   - step: *Unit-Test
                   - step: *E2E-Test
                   - step: *Build

Prashantanu Singh Rathore (Temp)
April 17, 2023

Okay. this link says stage does not parallel steps. 

https://support.atlassian.com/bitbucket-cloud/docs/stage-options/

DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events