azureazure-devopsazure-pipelinesazure-pipelines-release-task

Control Job Order in Azure DevOps Release Pipeline


I have a complicated release that spans multiple deployment groups and I am planning to use the 3rd party vsts-git-release-tag extension to tag the release. Ideally, the entire release (all jobs) would succeed first before tagging the repository.

So I am trying to work out what the best way to accomplish that is. If this were a build pipeline rather than a release pipeline, it is clear I could just arrange them using dependsOn, as follows.

jobs:
- job: Deployment_Group_1
  steps:
  - script: echo hello from Deployment Group 1
- job: Deployment_Group_2
  steps:
  - script: echo hello from Deployment Group 2
- job: Tag_Repo
  steps:
  - script: echo this is where I would tag the Repo
  dependsOn:
  - Deployment_Group_1
  - Deployment_Group_2

However, there doesn't seem to be equivalent functionality (at least currently) in release pipelines as specified in this document.

Note

Running multiple jobs in parallel is supported only in build pipelines at present. It is not yet supported in release pipelines.

Although it doesn't specifically mention the dependsOn feature, there doesn't seem to be a way to utilize it in release pipelines (correct me if I am wrong).

I realize I could probably create a separate stage containing a single job and task to create the Git tag, but that feels like a hack. Is there a better way to run a specific release job after all other release jobs have completed?


Solution

  • After creating a test project and adding several jobs to a release pipeline for it, then running it several times in a row, it appears that the order of the jobs is deterministic. That is, they always seem to run in the order that they physically appear in the portal.

    I did several Google searches, and this behavior doesn't seem be documented anywhere. So, I don't know for sure if it is guaranteed. But it will probably work for my case.

    Please leave a comment if there are any official sources that confirm that the job order is guaranteed.