管線定義

管線是一或多個描述 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 關鍵字,並直接指定 jobs 關鍵字:

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

如果您有單一階段和單一作業,您可以省略 stagesjobs 關鍵字,並直接指定 steps 關鍵字:

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

如果您有單一作業,您可以省略 jobs 關鍵字,並直接指定 steps 關鍵字:

# ... 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 字串。
管線執行編號。

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.

屬性

steps步驟。 必要。
要在此作業中執行的步驟清單。

strategyjobs.job.strategy
此作業的執行策略。

continueOnError 字串。
即使在失敗時仍繼續執行?

pool集區
除非另有指定,否則此管線中的作業將會執行所在的集區。

containerjobs.job.container
容器資源名稱。

services 字串字典。
要以服務容器身分執行的容器資源。

workspace工作區
代理程式的工作區選項。

name 字串。
管線執行編號。

trigger觸發程式
持續整合觸發程式。

parameters參數
管線範本參數。

prpr.
提取要求觸發程式。

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: 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 字串。
管線執行編號。

trigger觸發程式
持續整合觸發程式。

parameters參數
管線範本參數。

prpr.
提取要求觸發程式。

schedules排程
已排程的觸發程式。

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 字串字典。
要以服務容器身分執行的容器資源。

workspaceworkspace
代理程式的工作區選項。

name 字串。
管線執行編號。

trigger觸發程式。
持續整合觸發程式。

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 字串字典。
要以服務容器身分執行的容器資源。

workspaceworkspace
代理程式的工作區選項。

name 字串。
管線執行編號。

trigger觸發程式。
持續整合觸發程式。

prpr.
提取要求觸發程式。

resources資源
組建中使用的容器和存放庫。

variables變數
此管線的變數。

parameters 範本參數。
管線範本參數。

範例

trigger:
- main

pool: 
  vmImage: ubuntu-latest

steps:
- script: "Hello world!"

另請參閱