Sar
Sar

Reputation: 299

Multistage YAML pipeline to have seperate stage without dependencies

In Azure DevOps, I am using a Multistage YAML pipeline for Build and deployment. The screenshot shows the current pipeline setup. I wish to have sandbox1 separately without dependency on Build.

trigger: none
pr: none
stages:
- stage: 'Build'
  jobs:
  - job: 'Build'
    pool:
      vmImage: ubuntu-16.04
    steps:
    - checkout: none
    - powershell: |
        echo "Hello Testing"
- stage: 'Sandbox'
  jobs:
  - job: 'Sandbox'
    pool:
      vmImage: ubuntu-16.04
    steps:
    - checkout: none
    - powershell: |
        echo "Hello Testing"
- stage: 'DEV'
  jobs:
  - job: 'DEV'
    pool:
      vmImage: ubuntu-16.04
    steps:
    - checkout: none
    - powershell: |
        echo "Hello Testing"
- stage: 'QA'
  dependsOn: ['DEV','DEV1']
  jobs:
  - job: 'QA'
    pool:
      vmImage: ubuntu-16.04
    steps:
    - checkout: none
    - powershell: |
        echo "Hello Testing"
- stage: 'PROD'
  jobs:
  - job: 'DEV'
    pool:
      vmImage: ubuntu-16.04
    steps:
    - checkout: none
    - powershell: |
        echo "Hello Testing"
- stage: 'sandbox1'
  dependsOn: 'Build'
  jobs:
  - job: 'DEV1'
    pool:
      vmImage: ubuntu-16.04
    steps:
    - checkout: none
    - powershell: |
        echo "Hello Testing"
- stage: 'DEV1'
  jobs:
  - job: 'DEV1'
    pool:
      vmImage: ubuntu-16.04
    steps:
    - checkout: none
    - powershell: |
        echo "Hello Testing"

This is the pipeline structure I wish to have:

https://i.sstatic.net/Zj2L6.png I have added the sample YAML code

Is it possible?

Upvotes: 1

Views: 1490

Answers (1)

Cece Dong - MSFT
Cece Dong - MSFT

Reputation: 31003

Sorry for confusion. I missed a feature. Your requirement is able to be achieved, just make the dependsOn empty. Check the sample below:

- stage: 'sandbox1'
  dependsOn: []    # this removes the implicit dependency on previous stage and causes this to run in parallel

enter image description here

Upvotes: 6

Related Questions