I’m working on configuring a Bitbucket pipeline for my project and I’m facing a challenge with defining the execution order of the steps. Here’s the scenario:
I have a Bitbucket pipeline with four steps (step1, step2, step3, step4). What I want to achieve is to run step1 and step2 in parallel, and then, once both step1 and step2 are completed, run step3 and step4 in parallel.
image: node:18
pipelines:
default:
- parallel:
- step:
name: 'Build 1'
script:
- npm i
- npm run build
artifacts:
- 'public/'
- step:
name: 'Build 2'
script:
- npm i
- npm run build
- mv public build2-public
artifacts:
- 'build2-public/'
- step:
name: 'Build 1 deploy'
deployment: staging
script:
- cd public/
- ls
- step:
name: 'Build 2 deploy'
deployment: production
script:
- cd ve-public/
- ls
How can I modify this configuration to achieve the desired behavior? I want step1 and step2 to run simultaneously, and only after both are finished, step3 and step4 should start executing in parallel.
Any insights or suggestions on how to structure my pipeline YAML configuration would be greatly appreciated. Thank you!