管道定义

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

管道是描述 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 定义不太可能包含所有这些选项。

管道是描述 CI/CD 过程的一个或多个作业。 作业是可分配给同一台计算机的工作单位。 可以将作业排列到依赖项关系图中,例如“此作业取决于该作业的输出”。

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

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

- Pipeline
  - Job 1
    - Step 1.1
    - Step 1.2
    - ...
  - Job 2
    - Step 2.1
    - Step 2.2
    - ...

对于单作业管道,可以省略作业容器,因为只有步骤。 由于本文中显示的许多选项不是必需的,并且具有合理的默认值,因此 YAML 定义不太可能包含所有这些选项。

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

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

如果只有一个阶段和一个作业,可以省略 stagesjobs 关键字,并直接指定 steps 关键字:

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

如果只有一个作业,可以省略 jobs 关键字并直接指定步骤关键字:

# ... 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: string # Behavior lock requests from this stage should exhibit in relation to other exclusive lock requests.

属性

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

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

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

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

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

parameters参数
管道模板参数。

prpr.
拉取请求触发器。

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: string # Behavior lock requests from this stage should exhibit in relation to other exclusive lock requests.

属性

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

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

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

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

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

parameters参数
管道模板参数。

prpr.
拉取请求触发器。

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参数
管道模板参数。

prpr.
拉取请求触发器。

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参数
管道模板参数。

prpr.
拉取请求触发器。

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: string # Behavior lock requests from this stage should exhibit in relation to other exclusive lock requests.

属性

extends扩展。 必需。
扩展模板。

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

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

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

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

parameters参数
管道模板参数。

prpr.
拉取请求触发器。

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: string # Behavior lock requests from this stage should exhibit in relation to other exclusive lock requests.

属性

extends扩展。 必需。
扩展模板。

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

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

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

parameters参数
管道模板参数。

prpr.
拉取请求触发器。

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参数
管道模板参数。

prpr.
拉取请求触发器。

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参数
管道模板参数。

prpr.
拉取请求触发器。

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: string # Behavior lock requests from this stage should exhibit in relation to other exclusive lock requests.

属性

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

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

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

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

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

parameters参数
管道模板参数。

prpr.
拉取请求触发器。

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: string # Behavior lock requests from this stage should exhibit in relation to other exclusive lock requests.

属性

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

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

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

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

parameters参数
管道模板参数。

prpr.
拉取请求触发器。

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参数
管道模板参数。

prpr.
拉取请求触发器。

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参数
管道模板参数。

prpr.
拉取请求触发器。

schedules计划
计划的触发器。

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

variables变量
此管道的变量。

管道:作业

包含作业的管道。

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.

属性

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

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

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

prpr.
拉取请求触发器。

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

variables变量
此管道的变量。

parameters 模板参数。
管道模板参数。

示例

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: string # 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: string # Behavior lock requests from this stage should exhibit in relation to other exclusive lock requests.

属性

steps步骤。 必需。
要在此作业中运行的步骤列表。

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

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

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

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

services 字符串字典。
要作为服务容器运行的容器资源。

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

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

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

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

parameters参数
管道模板参数。

prpr.
拉取请求触发器。

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: string # 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: string # Behavior lock requests from this stage should exhibit in relation to other exclusive lock requests.

属性

steps步骤。 必需。
要在此作业中运行的步骤列表。

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

continueOnError 字符串。
即使发生故障,仍要继续运行?

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

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

services 字符串字典。
要作为服务容器运行的容器资源。

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

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

triggertrigger
持续集成触发器。

parameters参数
管道模板参数。

prpr.
拉取请求触发器。

schedulesschedules
计划的触发器。

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: string # 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步骤。 必需。
要在此作业中运行的步骤列表。

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

continueOnError 字符串。
即使发生故障,仍要继续运行?

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

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

services 字符串字典。
要作为服务容器运行的容器资源。

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

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

triggertrigger
持续集成触发器。

parameters参数
管道模板参数。

prpr.
拉取请求触发器。

schedulesschedules
计划的触发器。

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: string # 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步骤。 必需。
要在此作业中运行的步骤列表。

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

continueOnError 字符串。
即使发生故障,仍要继续运行?

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

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

services 字符串字典。
要作为服务容器运行的容器资源。

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

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

triggertrigger
持续集成触发器。

parameters参数
管道模板参数。

prpr.
拉取请求触发器。

schedulesschedules
计划的触发器。

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

variables变量
此管道的变量。

管道:步骤

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

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: string # 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.

属性

steps步骤。 必需。
要在此作业中运行的步骤列表。

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

continueOnError 字符串。
即使发生故障,仍要继续运行?

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

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

services 字符串字典。
要作为服务容器运行的容器资源。

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

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

triggertrigger
持续集成触发器。

prpr.
拉取请求触发器。

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

variables变量
此管道的变量。

parameters 模板参数。
管道模板参数。

管道:步骤

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

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: string # 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.

属性

steps步骤。 必需。
要在此作业中运行的步骤列表。

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

continueOnError 字符串。
即使发生故障,仍要继续运行?

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

services 字符串字典。
要作为服务容器运行的容器资源。

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

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

triggertrigger
持续集成触发器。

prpr.
拉取请求触发器。

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

variables变量
此管道的变量。

parameters 模板参数。
管道模板参数。

示例

trigger:
- main

pool: 
  vmImage: ubuntu-latest

steps:
- script: "Hello world!"

另请参阅