Add stages, dependencies, & conditions

TFS 2018

Note

Microsoft Visual Studio Team Foundation Server 2018 and earlier versions have the following differences in naming:

  • Pipelines for build and release are called definitions
  • Runs are called builds
  • Service connections are called service endpoints
  • Stages are called environments
  • Jobs are called phases

A stage is a logical boundary in an Azure DevOps pipeline. Stages can be used to group actions in your software development process (for example, build the app, run tests, deploy to preproduction). Each stage contains one or more jobs.

When you define multiple stages in a pipeline, by default, they run one after the other. Stages can also depend on each other. You can use the dependsOn keyword to define dependencies. Stages also can run based on the result of a previous stage with conditions.

To learn how stages work with parallel jobs and licensing, see Configure and pay for parallel jobs.

To find out how stages relate to other parts of a pipeline such as jobs, see Key pipelines concepts.

You can also learn more about how stages relate to parts of a pipeline in the YAML schema stages article.

This version of TFS doesn't support YAML.

Specify stages

This version of TFS doesn't support YAML pipelines.

Specify dependencies

This version of TFS doesn't support YAML pipelines.

Define conditions

You can specify the conditions under which each stage runs with expressions. By default, a stage runs if it doesn't depend on any other stage, or if all of the stages that it depends on have completed and succeeded. You can customize this behavior by forcing a stage to run even if a previous stage fails or by specifying a custom condition.

If you customize the default condition of the preceding steps for a stage, you remove the conditions for completion and success. So, if you use a custom condition, it's common to use and(succeeded(),custom_condition) to check whether the preceding stage ran successfully. Otherwise, the stage runs regardless of the outcome of the preceding stage.

Note

Conditions for failed ('JOBNAME/STAGENAME') and succeeded ('JOBNAME/STAGENAME') as shown in the following example work only for YAML pipelines.

This version of TFS doesn't support YAML pipelines.

Specify queuing policies

This version of TFS doesn't support YAML pipelines.

Specify approvals

This version of TFS doesn't support YAML pipelines.