Pipeline as Code
- Pipeline as Code is about representing the CI/CD pipeline in a format that can be stored in version control system
- Examples:
- Jenkins:
Jenkinsfile- Scripted Pipeline
- Declarative Pipeline
- Azure DevOps:
azure-pipelines.yaml - Github Actions:
.github\*.yaml
- Jenkins:
- Branch wise pipelines
Azure DevOps Pipelines
- To create pipeline we need to write a YAML file
- filename can be anything but
azure-pipelines.yamlis most widely used - This YAML has a schema (structure)

- YAML Pipelines can be created in visual studio code (install extension) or in azure devops pipelines section
Agents
- Azure DevOps Agents represent where we can run the pipeline
- Agents are of two types
- Microsoft Hosted
- Self Hosted
- Complete pipeline can be run on a single agent or we can have agent per stage or agent per job
- Agents docs
Steps/Tasks
- This is smallest unit of work where you execute the pipeline steps
- On a broader note we have two options
- task:
- These are reusable activities published by azure devops or other communities
- We can also create a custom azure devops task (it needs to written in javascript over nodejs)
- Predefined task list
- Community Based : Azure DevOps Market place
- other (script/command/….):
- These are low level activities where we mostly run the commands directly
- task:
Azure DevOps YAML Schema
Authoring Pipelins
- Watch classroom video for instructions
- First sample
---
pool:
vmImage: ubuntu-24.04
trigger:
- main
stages:
- stage: buildstage
jobs:
- job: buildjob
steps:
- task: Maven@4
inputs:
mavenPomFile: pom.xml
goals: validate
jdkVersionOption: '1.17'
