DevOps

Important Predefined variables -

Container Jobs -

container:
image: xyz
options: --hostname xyz-host --ip 192.168.0.1
steps:
- script: echo hello
###############################################################container: xyz:tag
steps:
- script: echo hello

Agent Node Pool

pool:
name: MY-WIN
demands: 'Agent.Name -equals myhost-01'
steps:
- script: echo hello world
#https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml

Run time Parameters

parameters:
- name: configs
type: string
default: 'x86,x64'
trigger: nonejobs:
- ${{ if contains(parameters.configs, 'x86') }}:
- job: x86
steps:
- script: echo Building x86...
- ${{ if contains(parameters.configs, 'x64') }}:
- job: x64
steps:
- script: echo Building x64...
- ${{ if contains(parameters.configs, 'arm') }}:
- job: arm
steps:
- script: echo Building arm...
parameters:
- name: runPerfTests
type: boolean
default: false
trigger: nonestages:
- stage: Build
displayName: Build
jobs:
- job: Build
steps:
- script: echo running Build
- stage: UnitTest
displayName: Unit Test
dependsOn: Build
jobs:
- job: UnitTest
steps:
- script: echo running UnitTest
- ${{ if eq(parameters.runPerfTests, true) }}:
- stage: PerfTest
displayName: Performance Test
dependsOn: Build
jobs:
- job: PerfTest
steps:
- script: echo running PerfTest
- stage: Deploy
displayName: Deploy
dependsOn: UnitTest
jobs:
- job: Deploy
steps:
- script: echo running UnitTest
Image from Microsoft

Pipeline Variables

echo '##vso[task.setVariable variable=myVar]myValue'Write-Host "##vso[task.setVariable variable=myVar]myValue"
steps:
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(System.DefaultWorkingDirectory)/bin/WebApp
artifactName: WebApp
steps:
- task: DownloadPipelineArtifact@2
inputs:
artifact: WebApp

Classic Pipeline vs YAML based

Classic Pipelines
YAML based Pipelines

Share Variable Across Stages

In quest of understanding How Systems Work !

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store