管道定义

管道是描述 CI/CD 过程的一个或多个阶段。

实现

执行 说明
管道:阶段 包含阶段的管道。
管道:扩展 扩展模板的管道。
管道:作业 包含作业和一个隐式阶段的管道。
管道:步骤 包含步骤和一个隐式作业的管道。

注解

管道是描述 CI/CD 过程的一个或多个阶段。 阶段是管道中的主要部门。 “生成此应用”、“运行这些测试”和“部署到预生产”这些阶段是很好的示例。

阶段是一个或多个作业,这些作业是可分配给同一台计算机的工作单位。 你可以将阶段和作业排列到依赖项关系图中。 示例包括“在那个阶段之前运行此阶段”和“此作业依赖于该作业的输出”。

作业是一系列线性步骤。 步骤可以是任务、脚本或对外部模板的引用。

此层次结构反映在 YAML 文件的结构中,如下所示:

- Pipeline
  - Stage A
    - Job 1
      - Step 1.1
      - Step 1.2
      - ...
    - Job 2
      - Step 2.1
      - Step 2.2
      - ...
  - Stage B
    - ...

简单管道不需要所有这些级别。 例如,在单作业生成中,可以省略阶段和作业的容器,因为只有步骤。 由于本文中显示的许多选项都不需要并且具有良好的默认值,因此 YAML 定义不太可能包含所有这些选项。

如果你有单个阶段,则可以省略 stages 关键字,并直接指定 作业 关键字:

# ... other pipeline-level keywords
jobs: [ job | template ]

如果你有单个阶段和单个作业,则可以省略 stagesjobs 关键字,并直接指定 步骤 关键字:

# ... other pipeline-level keywords
steps: [ script | bash | pwsh | powershell | checkout | task | template | ... ]

使用 name 属性配置管道运行编号。 有关详细信息,请参阅 配置运行或内部版本号

管道:阶段

包含阶段的管道。

stages: [ stage | template ] # Required. Stages are groups of jobs that can run without human intervention.
pool: string | pool # Pool where jobs in this pipeline will run unless otherwise specified.
name: string # Pipeline run number.
appendCommitMessageToRunName: boolean # Append the commit message to the build number. The default is true.
trigger: none | trigger | [ string ] # Continuous integration triggers.
parameters: [ parameter ] # Pipeline template parameters.
pr: none | pr | [ string ] # Pull request triggers.
schedules: [ cron ] # Scheduled 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.
  webhooks: [ webhook ] # List of webhooks.
  packages: [ package ] # List of package resources.
variables: variables | [ variable ] # Variables for this pipeline.
lockBehavior: sequential | runLatest # Behavior lock requests from this stage should exhibit in relation to other exclusive lock requests.

性能

stages 阶段。 必填。
阶段是无需人工干预即可运行的作业组。

pool
池,除非另有指定,否则此管道中的作业将运行。

name 字符串。
管道运行编号。

appendCommitMessageToRunName 布尔
将提交消息追加到内部版本号。 默认值为 true。

trigger 触发器
持续集成触发器。

parameters 参数
管道模板参数。

pr pr
拉取请求触发器。

schedules 计划
计划触发器。

resources 资源
生成中使用的容器和存储库。

variables 变量
此管道的变量。

lockBehavior 字符串。
此阶段的行为锁请求应与其他独占锁请求相关。 顺序 |runLatest。

管道:阶段

包含阶段的管道。

stages: [ stage | template ] # Required. Stages are groups of jobs that can run without human intervention.
pool: string | pool # Pool where jobs in this pipeline will run unless otherwise specified.
name: string # Pipeline run number.
trigger: none | trigger | [ string ] # Continuous integration triggers.
parameters: [ parameter ] # Pipeline template parameters.
pr: none | pr | [ string ] # Pull request triggers.
schedules: [ cron ] # Scheduled 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.
  webhooks: [ webhook ] # List of webhooks.
  packages: [ package ] # List of package resources.
variables: variables | [ variable ] # Variables for this pipeline.
lockBehavior: sequential | runLatest # Behavior lock requests from this stage should exhibit in relation to other exclusive lock requests.

性能

stages 阶段。 必填。
阶段是无需人工干预即可运行的作业组。

pool
池,除非另有指定,否则此管道中的作业将运行。

name 字符串。
管道运行编号。

有关允许的占位符,请参阅 配置运行或内部版本号

trigger 触发器
持续集成触发器。

parameters 参数
管道模板参数。

pr pr
拉取请求触发器。

schedules 计划
计划触发器。

resources 资源
生成中使用的容器和存储库。

variables 变量
此管道的变量。

lockBehavior 字符串。
此阶段的行为锁请求应与其他独占锁请求相关。 顺序 |runLatest。

管道:阶段

包含阶段的管道。

stages: [ stage | template ] # Required. Stages are groups of jobs that can run without human intervention.
pool: string | pool # Pool where jobs in this pipeline will run unless otherwise specified.
name: string # Pipeline run number.
trigger: none | trigger | [ string ] # Continuous integration triggers.
parameters: [ parameter ] # Pipeline template parameters.
pr: none | pr | [ string ] # Pull request triggers.
schedules: [ cron ] # Scheduled 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.
  webhooks: [ webhook ] # List of webhooks.
  packages: [ package ] # List of package resources.
variables: variables | [ variable ] # Variables for this pipeline.

性能

stages 阶段。 必填。
阶段是无需人工干预即可运行的作业组。

pool
池,除非另有指定,否则此管道中的作业将运行。

name 字符串。
管道运行编号。

trigger 触发器
持续集成触发器。

parameters 参数
管道模板参数。

pr pr
拉取请求触发器。

schedules 计划
计划触发器。

resources 资源
生成中使用的容器和存储库。

variables 变量
此管道的变量。

管道:阶段

包含阶段的管道。

stages: [ stage | template ] # Required. Stages are groups of jobs that can run without human intervention.
pool: string | pool # Pool where jobs in this pipeline will run unless otherwise specified.
name: string # Pipeline run number.
trigger: none | trigger | [ string ] # Continuous integration triggers.
parameters: [ parameter ] # Pipeline template parameters.
pr: none | pr | [ string ] # Pull request triggers.
schedules: [ cron ] # Scheduled 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.
  packages: [ package ] # List of package resources.
variables: variables | [ variable ] # Variables for this pipeline.

性能

stages 阶段。 必填。
阶段是无需人工干预即可运行的作业组。

pool
池,除非另有指定,否则此管道中的作业将运行。

name 字符串。
管道运行编号。

trigger 触发器
持续集成触发器。

parameters 参数
管道模板参数。

pr pr
拉取请求触发器。

schedules 计划
计划触发器。

resources 资源
生成中使用的容器和存储库。

variables 变量
此管道的变量。

例子

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"

管道:扩展

扩展模板的管道。

extends: # Required. Extends a template.
  template: string # The template referenced by the pipeline to extend.
  parameters: # Parameters used in the extend.
pool: string | pool # Pool where jobs in this pipeline will run unless otherwise specified.
name: string # Pipeline run number.
appendCommitMessageToRunName: boolean # Append the commit message to the build number. The default is true.
trigger: none | trigger | [ string ] # Continuous integration triggers.
parameters: [ parameter ] # Pipeline template parameters.
pr: none | pr | [ string ] # Pull request triggers.
schedules: [ cron ] # Scheduled 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.
  webhooks: [ webhook ] # List of webhooks.
  packages: [ package ] # List of package resources.
variables: variables | [ variable ] # Variables for this pipeline.
lockBehavior: sequential | runLatest # Behavior lock requests from this stage should exhibit in relation to other exclusive lock requests.

性能

extends 扩展。 必填。
扩展模板。

pool
池,除非另有指定,否则此管道中的作业将运行。

name 字符串。
管道运行编号。

appendCommitMessageToRunName 布尔
将提交消息追加到内部版本号。 默认值为 true。

trigger 触发器
持续集成触发器。

parameters 参数
管道模板参数。

pr pr
拉取请求触发器。

schedules 计划
计划触发器。

resources 资源
生成中使用的容器和存储库。

variables 变量
此管道的变量。

lockBehavior 字符串。
此阶段的行为锁请求应与其他独占锁请求相关。 顺序 |runLatest。

管道:扩展

扩展模板的管道。

extends: # Required. Extends a template.
  template: string # The template referenced by the pipeline to extend.
  parameters: # Parameters used in the extend.
pool: string | pool # Pool where jobs in this pipeline will run unless otherwise specified.
name: string # Pipeline run number.
trigger: none | trigger | [ string ] # Continuous integration triggers.
parameters: [ parameter ] # Pipeline template parameters.
pr: none | pr | [ string ] # Pull request triggers.
schedules: [ cron ] # Scheduled 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.
  webhooks: [ webhook ] # List of webhooks.
  packages: [ package ] # List of package resources.
variables: variables | [ variable ] # Variables for this pipeline.
lockBehavior: sequential | runLatest # Behavior lock requests from this stage should exhibit in relation to other exclusive lock requests.

性能

extends 扩展。 必填。
扩展模板。

pool
池,除非另有指定,否则此管道中的作业将运行。

name 字符串。
管道运行编号。

trigger 触发器
持续集成触发器。

parameters 参数
管道模板参数。

pr pr
拉取请求触发器。

schedules 计划
计划触发器。

resources 资源
生成中使用的容器和存储库。

variables 变量
此管道的变量。

lockBehavior 字符串。
此阶段的行为锁请求应与其他独占锁请求相关。 顺序 |runLatest。

管道:扩展

扩展模板的管道。

extends: # Required. Extends a template.
  template: string # The template referenced by the pipeline to extend.
  parameters: # Parameters used in the extend.
pool: string | pool # Pool where jobs in this pipeline will run unless otherwise specified.
name: string # Pipeline run number.
trigger: none | trigger | [ string ] # Continuous integration triggers.
parameters: [ parameter ] # Pipeline template parameters.
pr: none | pr | [ string ] # Pull request triggers.
schedules: [ cron ] # Scheduled 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.
  webhooks: [ webhook ] # List of webhooks.
  packages: [ package ] # List of package resources.
variables: variables | [ variable ] # Variables for this pipeline.

性能

extends 扩展。 必填。
扩展模板。

pool
池,除非另有指定,否则此管道中的作业将运行。

name 字符串。
管道运行编号。

trigger 触发器
持续集成触发器。

parameters 参数
管道模板参数。

pr pr
拉取请求触发器。

schedules 计划
计划触发器。

resources 资源
生成中使用的容器和存储库。

variables 变量
此管道的变量。

管道:扩展

扩展模板的管道。

extends: # Required. Extends a template.
  template: string # The template referenced by the pipeline to extend.
  parameters: # Parameters used in the extend.
pool: string | pool # Pool where jobs in this pipeline will run unless otherwise specified.
name: string # Pipeline run number.
trigger: none | trigger | [ string ] # Continuous integration triggers.
parameters: [ parameter ] # Pipeline template parameters.
pr: none | pr | [ string ] # Pull request triggers.
schedules: [ cron ] # Scheduled 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.
  packages: [ package ] # List of package resources.
variables: variables | [ variable ] # Variables for this pipeline.

性能

extends 扩展。 必填。
扩展模板。

pool
池,除非另有指定,否则此管道中的作业将运行。

name 字符串。
管道运行编号。

trigger 触发器
持续集成触发器。

parameters 参数
管道模板参数。

pr pr
拉取请求触发器。

schedules 计划
计划触发器。

resources 资源
生成中使用的容器和存储库。

variables 变量
此管道的变量。

管道:作业

包含作业和一个隐式阶段的管道。

jobs: [ job | deployment | template ] # Required. Jobs represent units of work which can be assigned to a single agent or server.
pool: string | pool # Pool where jobs in this pipeline will run unless otherwise specified.
name: string # Pipeline run number.
appendCommitMessageToRunName: boolean # Append the commit message to the build number. The default is true.
trigger: none | trigger | [ string ] # Continuous integration triggers.
parameters: [ parameter ] # Pipeline template parameters.
pr: none | pr | [ string ] # Pull request triggers.
schedules: [ cron ] # Scheduled 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.
  webhooks: [ webhook ] # List of webhooks.
  packages: [ package ] # List of package resources.
variables: variables | [ variable ] # Variables for this pipeline.
lockBehavior: sequential | runLatest # Behavior lock requests from this stage should exhibit in relation to other exclusive lock requests.

性能

jobs 作业。 必填。
作业表示可分配给单个代理或服务器的工时单位。

pool
池,除非另有指定,否则此管道中的作业将运行。

name 字符串。
管道运行编号。

appendCommitMessageToRunName 布尔
将提交消息追加到内部版本号。 默认值为 true。

trigger 触发器
持续集成触发器。

parameters 参数
管道模板参数。

pr pr
拉取请求触发器。

schedules 计划
计划触发器。

resources 资源
生成中使用的容器和存储库。

variables 变量
此管道的变量。

lockBehavior 字符串。
此阶段的行为锁请求应与其他独占锁请求相关。 顺序 |runLatest。

管道:作业

包含作业和一个隐式阶段的管道。

jobs: [ job | deployment | template ] # Required. Jobs represent units of work which can be assigned to a single agent or server.
pool: string | pool # Pool where jobs in this pipeline will run unless otherwise specified.
name: string # Pipeline run number.
trigger: none | trigger | [ string ] # Continuous integration triggers.
parameters: [ parameter ] # Pipeline template parameters.
pr: none | pr | [ string ] # Pull request triggers.
schedules: [ cron ] # Scheduled 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.
  webhooks: [ webhook ] # List of webhooks.
  packages: [ package ] # List of package resources.
variables: variables | [ variable ] # Variables for this pipeline.
lockBehavior: sequential | runLatest # Behavior lock requests from this stage should exhibit in relation to other exclusive lock requests.

性能

jobs 作业。 必填。
作业表示可分配给单个代理或服务器的工时单位。

pool
池,除非另有指定,否则此管道中的作业将运行。

name 字符串。
管道运行编号。

trigger 触发器
持续集成触发器。

parameters 参数
管道模板参数。

pr pr
拉取请求触发器。

schedules 计划
计划触发器。

resources 资源
生成中使用的容器和存储库。

variables 变量
此管道的变量。

lockBehavior 字符串。
此阶段的行为锁请求应与其他独占锁请求相关。 顺序 |runLatest。

管道:作业

包含作业和一个隐式阶段的管道。

jobs: [ job | deployment | template ] # Required. Jobs represent units of work which can be assigned to a single agent or server.
pool: string | pool # Pool where jobs in this pipeline will run unless otherwise specified.
name: string # Pipeline run number.
trigger: none | trigger | [ string ] # Continuous integration triggers.
parameters: [ parameter ] # Pipeline template parameters.
pr: none | pr | [ string ] # Pull request triggers.
schedules: [ cron ] # Scheduled 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.
  webhooks: [ webhook ] # List of webhooks.
  packages: [ package ] # List of package resources.
variables: variables | [ variable ] # Variables for this pipeline.

性能

jobs 作业。 必填。
作业表示可分配给单个代理或服务器的工时单位。

pool
池,除非另有指定,否则此管道中的作业将运行。

name 字符串。
管道运行编号。

trigger 触发器
持续集成触发器。

parameters 参数
管道模板参数。

pr pr
拉取请求触发器。

schedules 计划
计划触发器。

resources 资源
生成中使用的容器和存储库。

variables 变量
此管道的变量。

管道:作业

包含作业和一个隐式阶段的管道。

jobs: [ job | deployment | template ] # Required. Jobs represent units of work which can be assigned to a single agent or server.
pool: string | pool # Pool where jobs in this pipeline will run unless otherwise specified.
name: string # Pipeline run number.
trigger: none | trigger | [ string ] # Continuous integration triggers.
parameters: [ parameter ] # Pipeline template parameters.
pr: none | pr | [ string ] # Pull request triggers.
schedules: [ cron ] # Scheduled 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.
  packages: [ package ] # List of package resources.
variables: variables | [ variable ] # Variables for this pipeline.

性能

jobs 作业。 必填。
作业表示可分配给单个代理或服务器的工时单位。

pool
池,除非另有指定,否则此管道中的作业将运行。

name 字符串。
管道运行编号。

trigger 触发器
持续集成触发器。

parameters 参数
管道模板参数。

pr pr
拉取请求触发器。

schedules 计划
计划触发器。

resources 资源
生成中使用的容器和存储库。

variables 变量
此管道的变量。

例子

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"

管道:步骤

包含步骤和一个隐式作业的管道。

steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # 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 # Which parts of the workspace should be scorched before fetching.
name: string # Pipeline run number.
appendCommitMessageToRunName: boolean # Append the commit message to the build number. The default is true.
trigger: none | trigger | [ string ] # Continuous integration triggers.
parameters: [ parameter ] # Pipeline template parameters.
pr: none | pr | [ string ] # Pull request triggers.
schedules: [ cron ] # Scheduled 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.
  webhooks: [ webhook ] # List of webhooks.
  packages: [ package ] # List of package resources.
variables: variables | [ variable ] # Variables for this pipeline.
lockBehavior: sequential | runLatest # Behavior lock requests from this stage should exhibit in relation to other exclusive lock requests.

性能

steps 步骤。 必填。
此作业中运行的步骤列表。

strategy jobs.job.strategy
此作业的执行策略。

continueOnError 字符串。
即使在失败时继续运行?

pool
池,除非另有指定,否则此管道中的作业将运行。

container jobs.job.container
容器资源名称。

services 字符串字典。
容器资源以服务容器的形式运行。

workspace 工作区
代理上的工作区选项。

name 字符串。
管道运行编号。

appendCommitMessageToRunName 布尔
将提交消息追加到内部版本号。 默认值为 true。

trigger 触发器
持续集成触发器。

parameters 参数
管道模板参数。

pr pr
拉取请求触发器。

schedules 计划
计划触发器。

resources 资源
生成中使用的容器和存储库。

variables 变量
此管道的变量。

lockBehavior 字符串。
此阶段的行为锁请求应与其他独占锁请求相关。 顺序 |runLatest。

管道:步骤

包含步骤和一个隐式作业的管道。

steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # 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 # Which parts of the workspace should be scorched before fetching.
name: string # Pipeline run number.
trigger: none | trigger | [ string ] # Continuous integration triggers.
parameters: [ parameter ] # Pipeline template parameters.
pr: none | pr | [ string ] # Pull request triggers.
schedules: [ cron ] # Scheduled 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.
  webhooks: [ webhook ] # List of webhooks.
  packages: [ package ] # List of package resources.
variables: variables | [ variable ] # Variables for this pipeline.
lockBehavior: sequential | runLatest # Behavior lock requests from this stage should exhibit in relation to other exclusive lock requests.

性能

steps 步骤。 必填。
此作业中运行的步骤列表。

strategy jobs.job.strategy
此作业的执行策略。

continueOnError 字符串。
即使在失败时继续运行?

pool
池,除非另有指定,否则此管道中的作业将运行。

container jobs.job.container
容器资源名称。

services 字符串字典。
容器资源以服务容器的形式运行。

workspace 工作区
代理上的工作区选项。

name 字符串。
管道运行编号。

trigger 触发器
持续集成触发器。

parameters 参数
管道模板参数。

pr pr
拉取请求触发器。

schedules 计划
计划触发器。

resources 资源
生成中使用的容器和存储库。

variables 变量
此管道的变量。

lockBehavior 字符串。
此阶段的行为锁请求应与其他独占锁请求相关。 顺序 |runLatest。

管道:步骤

包含步骤和一个隐式作业的管道。

steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # 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 # Which parts of the workspace should be scorched before fetching.
name: string # Pipeline run number.
trigger: none | trigger | [ string ] # Continuous integration triggers.
parameters: [ parameter ] # Pipeline template parameters.
pr: none | pr | [ string ] # Pull request triggers.
schedules: [ cron ] # Scheduled 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.
  webhooks: [ webhook ] # List of webhooks.
  packages: [ package ] # List of package resources.
variables: variables | [ variable ] # Variables for this pipeline.

性能

steps 步骤。 必填。
此作业中运行的步骤列表。

strategy jobs.job.strategy
此作业的执行策略。

continueOnError 字符串。
即使在失败时继续运行?

pool
池,除非另有指定,否则此管道中的作业将运行。

container jobs.job.container
容器资源名称。

services 字符串字典。
容器资源以服务容器的形式运行。

workspace 工作区
代理上的工作区选项。

name 字符串。
管道运行编号。

trigger 触发器
持续集成触发器。

parameters 参数
管道模板参数。

pr pr
拉取请求触发器。

schedules 计划
计划触发器。

resources 资源
生成中使用的容器和存储库。

variables 变量
此管道的变量。

管道:步骤

包含步骤和一个隐式作业的管道。

steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # 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 # Which parts of the workspace should be scorched before fetching.
name: string # Pipeline run number.
trigger: none | trigger | [ string ] # Continuous integration triggers.
parameters: [ parameter ] # Pipeline template parameters.
pr: none | pr | [ string ] # Pull request triggers.
schedules: [ cron ] # Scheduled 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.
  packages: [ package ] # List of package resources.
variables: variables | [ variable ] # Variables for this pipeline.

性能

steps 步骤。 必填。
此作业中运行的步骤列表。

strategy jobs.job.strategy
此作业的执行策略。

continueOnError 字符串。
即使在失败时继续运行?

pool
池,除非另有指定,否则此管道中的作业将运行。

container jobs.job.container
容器资源名称。

services 字符串字典。
容器资源以服务容器的形式运行。

workspace 工作区
代理上的工作区选项。

name 字符串。
管道运行编号。

trigger 触发器
持续集成触发器。

parameters 参数
管道模板参数。

pr pr
拉取请求触发器。

schedules 计划
计划触发器。

resources 资源
生成中使用的容器和存储库。

variables 变量
此管道的变量。

例子

trigger:
- main

pool: 
  vmImage: ubuntu-latest

steps:
- script: "Hello world!"

另请参阅