Complete the code to define a Jenkins pipeline stage for Continuous Delivery.
stage('Deploy to Staging') { steps { [1] 'deploy-to-staging' } }
input instead of sh for running commands.The sh step runs shell commands, which is used here to deploy to staging in Continuous Delivery.
Complete the code to add a manual approval step in Continuous Delivery.
stage('Approval') { steps { [1] message: 'Approve deployment to production?' } }
sh instead of input for manual approval.The input step pauses the pipeline and waits for manual approval, which is key in Continuous Delivery.
Fix the error in the Jenkins pipeline code to enable Continuous Deployment.
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'make build'
}
}
stage('Deploy') {
steps {
[1] 'deploy-to-production'
}
}
}
}input which pauses for manual approval, not suitable for Continuous Deployment.For Continuous Deployment, the deployment step should run automatically without manual input, so sh is correct to run deployment commands.
Fill both blanks to create a Jenkins pipeline snippet that shows the difference between Continuous Delivery and Continuous Deployment.
pipeline {
agent any
stages {
stage('Deploy') {
steps {
[1] 'deploy-to-staging'
[2] message: 'Approve production deployment?'
}
}
}
}echo instead of sh for deployment commands.Continuous Delivery deploys to staging automatically (sh) but waits for manual approval (input) before production.
Fill all three blanks to complete a Jenkins pipeline snippet that automates deployment fully for Continuous Deployment.
pipeline {
agent any
stages {
stage('Build') {
steps {
[1] 'make build'
}
}
stage('Test') {
steps {
[2] 'make test'
}
}
stage('Deploy') {
steps {
[3] 'deploy-to-production'
}
}
}
}input which pauses the pipeline, not suitable for Continuous Deployment.In Continuous Deployment, all steps including build, test, and deploy run automatically using sh commands without manual approval.