DevOps Concepts
In Azure DevOps Pipelines, the structure is hierarchical. Diagram shows the typical flow:
Trigger → Pipeline → Stage → Job (runs on Agent) → Steps (Script/Task)
1️⃣ Stages
A Stage is a major phase of the pipeline.
Typical stages represent different parts of the CI/CD lifecycle.
Examples:
Build
Test
Deploy
stages: YAML
- stage: Build
- stage: Test
- stage: Deploy
2️⃣ Agents
An Agent is the machine that runs your pipeline jobs.
It executes the tasks like:
-
compiling code
-
running scripts
-
deploying applications
Agents can be:
Microsoft-hosted agents
Provided by Microsoft.
Example:
-
Ubuntu
-
Windows
-
macOS
Self-hosted agents
Your own machines or servers.
Example:
-
company build server
-
private VM
Example
pool:
vmImage: 'ubuntu-latest'
Here Ubuntu is the agent machine that executes the pipeline.
3️⃣ Jobs
A Job is a group of steps executed on one agent.
Important rules:
-
Each job runs on one agent
-
Jobs can run in parallel
-
Jobs contain steps
Example
jobs:
- job: BuildJob
steps:
So the hierarchy becomes:
Stage
└── Job
└── Steps
4️⃣ Steps
A Step is the smallest unit of work in a pipeline.
Steps can be:
Script
Run shell commands.
Example:
- script: ls -l
Task
Pre-built Azure DevOps task.
Examples:
-
Publish build artifact
-
Deploy to Azure App Service
-
Invoke REST API
Example:
- task: AzureWebApp@1
So steps perform the actual work.
5️⃣ Full Example Pipeline
Example combining everything:
trigger:
- main
stages:
- stage: Build
jobs:
- job: BuildJob
pool:
vmImage: ubuntu-latest
steps:
- script: npm install
- script: npm run build
- stage: Deploy
jobs:
- job: DeployJob
steps:
- task: AzureWebApp@1
6️⃣ How Your Diagram Maps to Azure DevOps
From your image:
| Diagram Element | Azure DevOps Concept |
|---|---|
| Trigger | Pipeline trigger (commit, PR, schedule) |
| Pipeline | Entire CI/CD workflow |
| Stage | Build / Test / Deploy phases |
| Agent | Machine executing the job |
| Job | Unit executed on an agent |
| Step | Script or Task |
7️⃣ Simple Real-World Analogy
Imagine building a car 🚗
| Concept | Example |
|---|---|
| Pipeline | Build a car |
| Stage | Assemble → Test → Deliver |
| Job | Install engine |
| Agent | Worker |
| Step | Tighten bolt |
✅ Simple hierarchy to remember
Pipeline
└── Stage
└── Job└── Steps
Comments
Post a Comment