共用方式為


管線定義

管線是一或多個描述 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!"

另請參閱