Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
A pipeline is one or more jobs that describe a CI/CD process.
Implementations
Implementation | Description |
---|---|
pipeline: jobs | Pipeline with jobs. |
pipeline: steps | Pipeline with steps and one implicit job. |
Remarks
A pipeline is one or more stages that describe a CI/CD process. Stages are the major divisions in a pipeline. The stages "Build this app," "Run these tests," and "Deploy to preproduction" are good examples.
A stage is one or more jobs, which are units of work assignable to the same machine. You can arrange both stages and jobs into dependency graphs. Examples include "Run this stage before that one" and "This job depends on the output of that job."
A job is a linear series of steps. Steps can be tasks, scripts, or references to external templates.
This hierarchy is reflected in the structure of a YAML file like:
- Pipeline
- Stage A
- Job 1
- Step 1.1
- Step 1.2
- ...
- Job 2
- Step 2.1
- Step 2.2
- ...
- Stage B
- ...
Simple pipelines don't require all of these levels. For example, in a single-job build, you can omit the containers for stages and jobs because there are only steps. And because many options shown in this article aren't required and have good defaults, your YAML definitions are unlikely to include all of them.
A pipeline is one or more jobs that describe a CI/CD process. A job is a unit of work assignable to the same machine. You can arrange jobs into dependency graphs like "This job depends on the output of that job."
A job is a linear series of steps. Steps can be tasks, scripts, or references to external templates.
This hierarchy is reflected in the structure of a YAML file like:
- Pipeline
- Job 1
- Step 1.1
- Step 1.2
- ...
- Job 2
- Step 2.1
- Step 2.2
- ...
For single-job pipelines, you can omit the jobs container because there are only steps. And because many options shown in this article aren't required and have good defaults, your YAML definitions are unlikely to include all of them.
If you have a single job, you can omit the jobs
keyword and directly specify the steps keyword:
# ... other pipeline-level keywords
steps: [ script | bash | pwsh | powershell | checkout | task | template | ... ]
Use the name
property to configure the pipeline run number. For more information, see Configure run or build numbers.
Examples
trigger:
- main
pool:
vmImage: ubuntu-latest
stages:
- stage: CI
jobs:
- job: CIWork
steps:
- script: "Do CI work"
- stage: Test
jobs:
- job: TestWork
steps:
- script: "Do test work"
pipeline: jobs
Pipeline with jobs.
jobs: [ job ] # Required. Jobs represent units of work which can be assigned to a single agent or server.
name: string # Pipeline run number.
trigger: none | trigger | [ string ] # Continuous integration triggers.
pr: none | pr | [ string ] # Pull request triggers.
resources: # Containers and repositories used in the build.
builds: [ build ] # List of build resources referenced by the pipeline.
containers: [ container ] # List of container images.
pipelines: [ pipeline ] # List of pipeline resources.
repositories: [ repository ] # List of repository resources.
variables: variables | [ variable ] # Variables for this pipeline.
parameters: # Pipeline template parameters.
Properties
jobs
jobs. Required.
Jobs represent units of work which can be assigned to a single agent or server.
name
string.
Pipeline run number.
trigger
trigger.
Continuous integration triggers.
pr
pr.
Pull request triggers.
resources
resources.
Containers and repositories used in the build.
variables
variables.
Variables for this pipeline.
parameters
template parameters.
Pipeline template parameters.
Examples
trigger:
- main
pool:
vmImage: ubuntu-latest
jobs:
- job: PreWork
steps:
- script: "Do pre-work"
- job: PostWork
pool: windows-latest
steps:
- script: "Do post-work using a different hosted image"
pipeline: steps
Pipeline with steps and one implicit job.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | publish | template ] # Required. A list of steps to run in this job.
strategy: strategy # Execution strategy for this job.
continueOnError: string # Continue running even on failure?
pool: string | pool # Pool where jobs in this pipeline will run unless otherwise specified.
container: string | container # Container resource name.
services: # Container resources to run as a service container.
string: string # Name/value pairs
workspace: # Workspace options on the agent.
clean: outputs | resources | all # Scorch the repo before fetching?
name: string # Pipeline run number.
trigger: none | trigger | [ string ] # Continuous integration triggers.
pr: none | pr | [ string ] # Pull request triggers.
resources: # Containers and repositories used in the build.
builds: [ build ] # List of build resources referenced by the pipeline.
containers: [ container ] # List of container images.
pipelines: [ pipeline ] # List of pipeline resources.
repositories: [ repository ] # List of repository resources.
variables: variables | [ variable ] # Variables for this pipeline.
parameters: # Pipeline template parameters.
Properties
steps
steps. Required.
A list of steps to run in this job.
strategy
jobs.job.strategy.
Execution strategy for this job.
continueOnError
string.
Continue running even on failure?
pool
pool.
Pool where jobs in this pipeline will run unless otherwise specified.
container
jobs.job.container.
Container resource name.
services
string dictionary.
Container resources to run as a service container.
workspace
workspace.
Workspace options on the agent.
name
string.
Pipeline run number.
trigger
trigger.
Continuous integration triggers.
pr
pr.
Pull request triggers.
resources
resources.
Containers and repositories used in the build.
variables
variables.
Variables for this pipeline.
parameters
template parameters.
Pipeline template parameters.
pipeline: steps
Pipeline with steps and one implicit job.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | publish | template ] # Required. A list of steps to run in this job.
strategy: strategy # Execution strategy for this job.
continueOnError: string # Continue running even on failure?
pool: string | pool # Pool where jobs in this pipeline will run unless otherwise specified.
services: # Container resources to run as a service container.
string: string # Name/value pairs
workspace: # Workspace options on the agent.
clean: outputs | resources | all # Scorch the repo before fetching?
name: string # Pipeline run number.
trigger: none | trigger | [ string ] # Continuous integration triggers.
pr: none | pr | [ string ] # Pull request triggers.
resources: # Containers and repositories used in the build.
builds: [ build ] # List of build resources referenced by the pipeline.
containers: [ container ] # List of container images.
pipelines: [ pipeline ] # List of pipeline resources.
repositories: [ repository ] # List of repository resources.
variables: variables | [ variable ] # Variables for this pipeline.
parameters: # Pipeline template parameters.
Properties
steps
steps. Required.
A list of steps to run in this job.
strategy
jobs.job.strategy.
Execution strategy for this job.
continueOnError
string.
Continue running even on failure?
pool
pool.
Pool where jobs in this pipeline will run unless otherwise specified.
services
string dictionary.
Container resources to run as a service container.
workspace
workspace.
Workspace options on the agent.
name
string.
Pipeline run number.
trigger
trigger.
Continuous integration triggers.
pr
pr.
Pull request triggers.
resources
resources.
Containers and repositories used in the build.
variables
variables.
Variables for this pipeline.
parameters
template parameters.
Pipeline template parameters.
Examples
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- script: "Hello world!"