0
0
Jenkinsdevops~30 mins

What is Continuous Delivery vs Continuous Deployment in Jenkins - Hands-On Activity

Choose your learning style9 modes available
Understanding Continuous Delivery vs Continuous Deployment with Jenkins
📖 Scenario: You are working as a DevOps engineer at a software company. Your team wants to automate the process of delivering software updates to users. You will learn the difference between Continuous Delivery and Continuous Deployment using Jenkins, a popular automation tool.
🎯 Goal: Build a simple Jenkins pipeline script that demonstrates the concepts of Continuous Delivery and Continuous Deployment by controlling when the software is automatically released to users.
📋 What You'll Learn
Create a Jenkins pipeline script with a variable to control deployment mode
Add a stage to build the software
Add a stage to deploy the software only if in Continuous Deployment mode
Print messages to show whether deployment is automatic or manual
💡 Why This Matters
🌍 Real World
Software teams use Jenkins pipelines to automate building and deploying applications. Understanding Continuous Delivery vs Continuous Deployment helps teams decide when to release software automatically or with manual checks.
💼 Career
DevOps engineers and automation specialists often configure Jenkins pipelines to implement Continuous Delivery or Continuous Deployment strategies, improving software release speed and reliability.
Progress0 / 4 steps
1
Create a Jenkins pipeline with a deployment mode variable
Create a Jenkins pipeline script and define a variable called deploymentMode with the value "Continuous Delivery".
Jenkins
Need a hint?

Use the environment block to define the deploymentMode variable.

2
Add a build stage to the Jenkins pipeline
Add a stage called Build inside the stages block that prints "Building the software...".
Jenkins
Need a hint?

Use stage('Build') and inside steps use echo to print the message.

3
Add a deploy stage that runs only in Continuous Deployment mode
Add a stage called Deploy that runs only if deploymentMode equals "Continuous Deployment". Inside, print "Automatically deploying the software...". Use when { expression { deploymentMode == 'Continuous Deployment' } } to control this.
Jenkins
Need a hint?

Use the when block with an expression to check deploymentMode.

4
Print the deployment mode and explain the difference
Add a post block with always that prints "Deployment mode is: " + deploymentMode and if deploymentMode is "Continuous Delivery", also print "Deployment requires manual approval." Otherwise, print "Deployment is automatic."
Jenkins
Need a hint?

Use the post block with always and a script block to run conditional echo commands.