Azure DevOps, setting up a job tha depends on multiple jobs

Viewed 4892

I'm setting up an azure pipeline using YAML with some jobs, I have one job that depends on multiple other jobs.

jobs:

  • job: A ...

  • job: B ...

  • job: C

    dependsOn: A, B

running this code gave me an error 'Job Artifact depends on unknown job A,B.'

2 Answers

I corrected the sysntax

- job: C

  dependsOn:
    - A
    - B 
  

Adding conditions to the above answer. If either one of the job needs to be successful for job C to get started.

- job: C
  dependsOn:
    - A
    - B
  condition: |
    or
    (
      eq(dependencies.A.result, 'Succeeded'),
      eq(dependencies.B.result, 'Succeeded')
    )
 

This article might help

Related