stages list definition
Stages are a collection of related jobs.
stages: [ stage | template ] #
Properties that use this definition: pipeline.stages
List types
| Type | Description |
|---|---|
| stages.stage | Stages defined in a pipeline. |
| stages.template | Stages defined in a template file. |
stages: [ stage | template ] #
Properties that use this definition: pipeline.stages
List types
| Type | Description |
|---|---|
| stages.stage | Stages defined in a pipeline. |
| stages.template | Stages defined in a template file. |
stages: [ stage | template ] #
Properties that use this definition: pipeline.stages
List types
| Type | Description |
|---|---|
| stages.stage | Stages defined in a pipeline. |
| stages.template | Stages defined in a template file. |
stages: [ stage | template ] #
Properties that use this definition: pipeline.stages
List types
| Type | Description |
|---|---|
| stages.stage | Stages defined in a pipeline. |
| stages.template | Stages defined in a template file. |
Remarks
By default, stages run sequentially. Each stage starts only after the preceding stage is complete unless otherwise specified via the dependsOn property.
Use approval checks to manually control when a stage should run. These checks are commonly used to control deployments to production environments.
Checks are a mechanism available to the resource owner. They control when a stage in a pipeline consumes a resource. As an owner of a resource like an environment, you can define checks that are required before a stage that consumes the resource can start.
Currently, manual approval checks are supported on environments. For more information, see Approvals.
Examples
This example runs three stages, one after another. The middle stage runs two jobs in parallel.
stages:
- stage: Build
jobs:
- job: BuildJob
steps:
- script: echo Building!
- stage: Test
jobs:
- job: TestOnWindows
steps:
- script: echo Testing on Windows!
- job: TestOnLinux
steps:
- script: echo Testing on Linux!
- stage: Deploy
jobs:
- job: Deploy
steps:
- script: echo Deploying the code!
This example runs two stages in parallel. For brevity, the jobs and steps are omitted.
stages:
- stage: BuildWin
displayName: Build for Windows
- stage: BuildMac
displayName: Build for Mac
dependsOn: [] # by specifying an empty array, this stage doesn't depend on the stage before it
See also
Learn more about stages, conditions, and variables.
Feedback
Submit and view feedback for