0
0
Jenkinsdevops~10 mins

Deployment pipelines (dev, staging, prod) in Jenkins - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Deployment pipelines (dev, staging, prod)
Start: Code Commit
Build & Test
Deploy to Dev
Manual Approval?
NoStop Pipeline
Yes
Deploy to Staging
Automated Tests on Staging
Manual Approval?
NoStop Pipeline
Yes
Deploy to Production
End
The pipeline starts with code commit, then builds and tests the code, deploys to dev, waits for manual approval to deploy to staging, runs tests, waits for approval again, and finally deploys to production.
Execution Sample
Jenkins
pipeline {
  agent any
  stages {
    stage('Deploy to Dev') {
      steps { echo 'Deploying to Dev' }
    }
  }
}
A simple Jenkins pipeline stage that deploys the code to the development environment.
Process Table
StepActionEnvironmentApproval NeededResult
1Code committedN/ANoPipeline triggered
2Build and testN/ANoBuild successful
3Deploy to DevDevNoDeployment successful
4Manual approval for Staging?N/AYesWaiting for approval
5Approval grantedN/AYesProceed to Staging
6Deploy to StagingStagingNoDeployment successful
7Run automated testsStagingNoTests passed
8Manual approval for Prod?N/AYesWaiting for approval
9Approval grantedN/AYesProceed to Production
10Deploy to ProductionProductionNoDeployment successful
11Pipeline endsN/ANoDeployment complete
💡 Pipeline ends after successful deployment to Production.
Status Tracker
VariableStartAfter Step 3After Step 6After Step 10Final
EnvironmentN/ADevStagingProductionProduction
Approval StatusNoNoYes (granted)Yes (granted)Yes
Deployment StatusNot startedDev deployedStaging deployedProduction deployedCompleted
Key Moments - 3 Insights
Why does the pipeline wait after deploying to Dev?
The pipeline waits for manual approval before deploying to Staging, as shown in step 4 and 5 in the execution table.
What happens if the manual approval is not granted?
The pipeline stops and does not proceed to the next environment, as indicated by the 'Waiting for approval' state in the execution table.
Why are automated tests run after deploying to Staging?
Automated tests verify the deployment in Staging before moving to Production, ensuring stability, as shown in step 7.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, at which step does the pipeline deploy to the Staging environment?
AStep 6
BStep 3
CStep 9
DStep 10
💡 Hint
Check the 'Environment' column for 'Staging' deployment in the execution table.
According to the variable tracker, what is the 'Approval Status' after Step 3?
AYes (granted)
BNo
CWaiting
DNot applicable
💡 Hint
Look at the 'Approval Status' row under 'After Step 3' in the variable tracker.
If the manual approval at Step 8 is denied, what happens to the pipeline?
AIt proceeds to deploy to Production anyway
BIt loops back to Staging deployment
CIt stops and does not deploy to Production
DIt restarts from the beginning
💡 Hint
Refer to the key moment about manual approval and the execution table steps 8 and 9.
Concept Snapshot
Deployment pipelines automate moving code through environments.
Stages: Build & Test -> Dev -> Staging -> Production.
Manual approvals control promotion between stages.
Automated tests run in Staging to ensure quality.
Pipeline stops if approvals are denied.
Jenkins pipelines define these steps clearly.
Full Transcript
This visual execution shows a Jenkins deployment pipeline moving code from development to production. It starts with a code commit triggering build and test. Then the code deploys to the development environment automatically. The pipeline pauses for manual approval before deploying to staging. After deploying to staging, automated tests run to verify stability. Another manual approval is required before deploying to production. If approvals are denied, the pipeline stops. Variables track environment, approval status, and deployment status at each step. This step-by-step flow helps beginners understand how deployment pipelines control safe code promotion.