Author : HASSAN MD TAREQ | Updated : 2021/10/22

About YAML-based Pipeline

There 2 types of pipelines:

YAML-based

Syntax Overview

pool:
  vmImage: 'ubuntu-latest'

variables:
- group: "demo-vg"

stages:

- stage: Build
  displayName: My Build Stage
  jobs:
  - job: BuildJob
    displayName: My Build Job
    steps:
    - task: xxx
    - script: xxx

	
- stage: Test
  displayName: My Test Stage
  jobs:
  - job: TestJobOne
    displayName: My Test Job 1
    steps:
    - script: xxx
    - task: xxx
	
  - job: TestJobTwo
    displayName: My Test Job 2
    steps:
    - script: xxx
    - task: xxx
	
- stage: Deploy
  displayName: My Deploy Stage
  jobs:
  - job: DeployJob
    displayName: My Deploy Job
    continueOnError: false
    steps:
    - script: xxx
    - task: xxx

Trigger

Pool

Stage

stages:
- stage: # name of the stage, A-Z, a-z, 0-9, and underscore
  displayName: # friendly name to display in the UI
  dependsOn:
  condition:
  pool: # pool for stage
  variables: # stage scoped variables
  jobs:
  - job: xxx
    displayName: xxx
  - job: yyy
    displayName: yyy

See: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/stages?view=azure-devops&tabs=yaml#specify-stages

Job

See job schema: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml#define-a-single-job

Deployment and Deployment Job

Deployment jobs provide the following benefits:

See schema for deployment job: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/deployment-jobs?view=azure-devops#schema

Task

https://docs.microsoft.com/en-us/azure/devops/pipelines/process/tasks

Template

https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates