Bird
Raised Fist0
Jenkinsdevops~5 mins

What is Continuous Delivery vs Continuous Deployment in Jenkins - CLI Guide

Choose your learning style10 modes available
Introduction
Continuous Delivery and Continuous Deployment help teams deliver software faster and more reliably. They automate steps to get code changes ready for users, reducing manual work and errors.
When you want to automatically prepare your software for release but review it before going live.
When you want every code change to be automatically tested and deployed to users without manual steps.
When you want to reduce the risk of bugs by releasing small, frequent updates.
When you want to improve team collaboration by automating build and test processes.
When you want to speed up feedback from users by delivering updates quickly.
Commands
This command updates or creates a Jenkins pipeline job from the YAML file. It sets up the automation for building, testing, and deploying your app.
Terminal
jenkins-jobs --conf jenkins.ini update my-pipeline.yaml
Expected OutputExpected
Job 'my-pipeline' updated successfully
This command starts the Jenkins pipeline job manually to run the automated steps defined in the pipeline.
Terminal
jenkins build my-pipeline
Expected OutputExpected
Started build #1 for job 'my-pipeline'\nBuilding in workspace /var/lib/jenkins/workspace/my-pipeline\n[Pipeline] Start of Pipeline\n...\nFinished: SUCCESS
This command shows the current configuration of the Jenkins job to verify the pipeline setup.
Terminal
jenkins get-job my-pipeline
Expected OutputExpected
Job: my-pipeline\nStatus: Enabled\nLast Build: #1 SUCCESS
Key Concept

If you remember nothing else, remember: Continuous Delivery prepares your code for release automatically but waits for your approval, while Continuous Deployment releases every change automatically to users.

Common Mistakes
Confusing Continuous Delivery with Continuous Deployment and expecting automatic releases without approval.
This causes confusion about when code reaches users and can lead to unexpected live changes.
Understand that Continuous Delivery requires manual approval before release, while Continuous Deployment does not.
Not automating tests in the pipeline, leading to risky deployments.
Without tests, bugs can reach users causing failures and downtime.
Include automated tests in your Jenkins pipeline to catch issues early.
Summary
Continuous Delivery automates preparing code for release but waits for manual approval to deploy.
Continuous Deployment automates releasing every change to users without manual steps.
Jenkins pipelines automate building, testing, and deploying software to support these practices.

Practice

(1/5)
1. What is the main difference between Continuous Delivery and Continuous Deployment?
easy
A. Continuous Delivery only builds code, Continuous Deployment only tests code.
B. Continuous Delivery deploys every change automatically, Continuous Deployment requires manual approval.
C. Continuous Delivery requires manual approval before production deployment, Continuous Deployment does not.
D. Continuous Delivery and Continuous Deployment are exactly the same.

Solution

  1. Step 1: Understand Continuous Delivery

    Continuous Delivery automates preparing the software for release but waits for a manual step to deploy to production.
  2. Step 2: Understand Continuous Deployment

    Continuous Deployment automates the entire process, including automatic deployment to production without manual approval.
  3. Final Answer:

    Continuous Delivery requires manual approval before production deployment, Continuous Deployment does not. -> Option C
  4. Quick Check:

    Manual approval = Continuous Delivery [OK]
Hint: Manual step means Continuous Delivery, no manual means Continuous Deployment [OK]
Common Mistakes:
  • Confusing which process needs manual approval
  • Thinking both deploy automatically
  • Mixing build and deploy steps
2. Which Jenkins pipeline step is typically used to pause for manual approval in Continuous Delivery?
easy
A. input
B. deploy
C. build
D. test

Solution

  1. Step 1: Identify Jenkins step for manual pause

    The input step in Jenkins pipeline pauses the pipeline and waits for user approval.
  2. Step 2: Confirm other steps roles

    deploy runs deployment, build compiles code, test runs tests, none pause for approval.
  3. Final Answer:

    input -> Option A
  4. Quick Check:

    Manual approval step = input [OK]
Hint: Pause for approval uses 'input' step in Jenkins [OK]
Common Mistakes:
  • Choosing deploy as manual step
  • Confusing build or test with approval
  • Not knowing Jenkins pipeline steps
3. Given this Jenkins pipeline snippet for Continuous Delivery:
stage('Deploy to Prod') {
  steps {
    input 'Approve deployment?'
    sh 'deploy.sh'
  }
}

What happens when this pipeline reaches the Deploy to Prod stage?
medium
A. The pipeline pauses and waits for manual approval before running deployment.
B. The pipeline fails with a syntax error.
C. The pipeline skips deployment and ends.
D. The deployment script runs immediately without pause.

Solution

  1. Step 1: Analyze the input step in the stage

    The input 'Approve deployment?' pauses the pipeline and waits for a user to approve before continuing.
  2. Step 2: Understand what happens after approval

    After approval, the shell script deploy.sh runs to deploy the application.
  3. Final Answer:

    The pipeline pauses and waits for manual approval before running deployment. -> Option A
  4. Quick Check:

    input step causes pause = The pipeline pauses and waits for manual approval before running deployment. [OK]
Hint: input step pauses pipeline until approval [OK]
Common Mistakes:
  • Assuming deploy runs immediately
  • Thinking pipeline skips deployment
  • Confusing syntax error with input step
4. You have a Jenkins pipeline intended for Continuous Deployment but it includes this code:
stage('Deploy') {
  steps {
    input 'Approve deployment?'
    sh 'deploy.sh'
  }
}

What is the problem if you want full Continuous Deployment?
medium
A. The pipeline syntax is invalid and will fail.
B. The input step causes manual approval, breaking full automation.
C. The deploy.sh script is missing required parameters.
D. The stage name should be 'Continuous Deployment' instead of 'Deploy'.

Solution

  1. Step 1: Identify manual approval in pipeline

    The input step pauses for manual approval, which is not allowed in full Continuous Deployment.
  2. Step 2: Understand Continuous Deployment automation

    Continuous Deployment requires no manual steps; every change deploys automatically.
  3. Final Answer:

    The input step causes manual approval, breaking full automation. -> Option B
  4. Quick Check:

    Manual approval breaks Continuous Deployment [OK]
Hint: No manual steps allowed in Continuous Deployment [OK]
Common Mistakes:
  • Thinking syntax error causes failure
  • Assuming deploy.sh script is the problem
  • Confusing stage name with functionality
5. You want to convert a Jenkins pipeline from Continuous Delivery to Continuous Deployment. Which change should you make?
hard
A. Rename the pipeline to 'Continuous Deployment' without changing steps.
B. Add more manual approval steps to ensure safety.
C. Change the build step to run tests only.
D. Remove the manual input approval step so deployment runs automatically.

Solution

  1. Step 1: Identify manual approval in Continuous Delivery

    Continuous Delivery pipelines pause for manual approval using the input step.
  2. Step 2: Remove manual approval for Continuous Deployment

    To achieve Continuous Deployment, remove the input step so deployment happens automatically after tests.
  3. Final Answer:

    Remove the manual input approval step so deployment runs automatically. -> Option D
  4. Quick Check:

    Remove manual steps for Continuous Deployment [OK]
Hint: Remove input step to automate deployment fully [OK]
Common Mistakes:
  • Adding manual steps instead of removing
  • Changing unrelated build steps
  • Only renaming pipeline without changing logic
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard