What is the main advantage of using the blue-green deployment pattern in Jenkins pipelines?
Think about how user traffic is managed during deployment.
Blue-green deployment uses two identical environments (blue and green). One serves live traffic while the other is updated. Switching traffic avoids downtime.
Given this Jenkins pipeline snippet for blue-green deployment, what will be the output of the sh step?
stage('Switch Traffic') {
steps {
sh 'echo Switching traffic to green environment'
}
}What does the sh step do in Jenkins pipelines?
The sh step runs shell commands and prints their output. Here it echoes the message about switching traffic.
Which Jenkinsfile snippet correctly implements switching traffic from blue to green environment using environment variables?
Focus on the environment variable value that matches the target environment for traffic switch.
Setting ACTIVE_ENV to 'green' and updating the deployment image to use that environment switches traffic correctly. 'red' is invalid and 'blue' would switch back.
After running a blue-green deployment pipeline, users report downtime. Which Jenkins pipeline issue is the most likely cause?
Think about what happens if traffic is switched too early.
If traffic switches before the new environment is ready, users experience downtime or errors. Proper readiness checks prevent this.
Arrange the following steps in the correct order for a blue-green deployment pipeline in Jenkins.
Think about deploying first, then testing, then switching traffic, then monitoring.
The correct order is to deploy to the inactive environment, test it, switch traffic, then monitor for issues to ensure smooth deployment.