Author : MD TAREQ HASSAN | Updated : 2022/01/06

Concepts

Hierarchy

Pipeline
→ Stages
→ → Jobs
→ → → Steps (Tasks, Scripts)

[Image courtesy: Microsoft doc.]

Conceptual Overview of Azure DevOps pipeline

About YAML pipeline

Pipeline structure: https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema%2Cparameter-schema#pipeline-structure

Syntax

resources: # define reosurces (i.e. variable group, pipeline etc.) that can be used in this pipline as resource
  xxx:
  - x:
    y:
  variables:
  - group: "demo-vg"

pool:
  vmImage: 'ubuntu-latest'
  
trigger:
  - branchName

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

Details: YAML pipeline trigger

Stage

Example: https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=example%2Cparameter-schema#stage

Job

Example: https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=example%2Cparameter-schema#job

Step

Example: https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=example%2Cparameter-schema#steps

Task

Example: https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=example%2Cparameter-schema#task

Script

Example: https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=example%2Cparameter-schema#script

Deployment

Resource

Environment:

CI and CD