Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 1

CI/CD in DevOps Toolchains

Recommended resources

Introduction

Welcome to the start of your journey into Jenkins! Your goal is to gain the skills for a professional DevOps role, specifically by learning to build and manage CI/CD pipelines from the ground up. This first lesson lays the crucial conceptual foundation for all the hands-on work to come. We will focus on outlining the roles of Continuous Integration and Continuous Delivery (CI/CD) in the modern software development landscape. By the end of this lesson, you will understand the problems CI/CD solves, the core principles behind it, and how it forms the backbone of DevOps. This understanding will provide the essential context for why we use a tool like Jenkins and what we are trying to achieve with it.


The Problem: Before Automation

To appreciate the solution, we must first understand the problem. In traditional software development, the process of integrating code from multiple developers and deploying it to servers was often a slow, manual, and error-prone ordeal. This frequently led to what developers call "integration hell," where merging weeks of work resulted in massive conflicts, broken builds, and long, stressful nights trying to fix bugs right before a release.

To see a vivid illustration of this scenario, watch the following segment from the "CI/CD Explained" video by TechWorld with Nana. It masterfully tells the story of a typical, inefficient workflow, highlighting the pain points that led to the development of CI/CD practices.

CI/CD Explained: The DevOps Skill That Makes You 10x More Valuable

This video provides a real-world scenario of software development without CI/CD.

Watch the section that describes the manual process. As you watch, take note of the bottlenecks and human-dependent steps, such as manual merging, testing, and deployment.

As the video shows, this manual process is constrained at every stage by human intervention, making it slow, risky, and difficult to scale. This is the core problem that CI/CD was designed to solve.


Continuous Integration (CI): The First Pillar

Continuous Integration (CI) is the practice of automating the integration of code changes from multiple contributors into a single shared repository. The key idea is for developers to commit their code in small, frequent batches.

Every time a change is committed, an automated process kicks in to:

  1. Build the application.
  2. Run a suite of automated tests (like unit tests and integration tests).

If the build or any test fails, the system immediately notifies the developer. This provides a rapid feedback loop, allowing bugs to be found and fixed quickly, often within minutes of being introduced. This prevents the "integration hell" we discussed earlier, as conflicts are small and manageable, and the main codebase remains stable.

Let's return to the "CI/CD Explained" video to see how CI addresses the initial problems of manual integration.

CI/CD Explained: The DevOps Skill That Makes You 10x More Valuable

This part of the video explains how Continuous Integration directly solves the problems of integration hell and late-stage bug discovery.

Watch the segment explaining Continuous Integration. Notice how the emphasis shifts to frequent, small commits and automated testing before merging to the main branch.

For a concise, text-based summary of CI, please read the following section from the GeeksforGeeks article "What is CI/CD?".

What is CI/CD?

This article clearly defines the core concepts of CI/CD.

Focus on the section defining CI. This reinforces the goal, process, and automation aspects of this practice.


Continuous Delivery and Continuous Deployment (CD): The Second Pillar

Once your code is successfully integrated and tested, the next step is to deliver it. This is where the "CD" part of CI/CD comes in, and it has two common interpretations: Continuous Delivery and Continuous Deployment. While related, the distinction is important.

  • Continuous Delivery is a practice where, after the CI stage, the code is automatically built, tested, and prepared for release to production. The entire process, up to the final deployment, is automated. However, the final push to the live production environment requires a manual approval—a human decision to click a "deploy" button. This ensures that the code can be deployed at any time but gives a human operator final control over when it is deployed.

  • Continuous Deployment takes this one step further. It automates the entire pipeline. If the build passes all automated tests in the CI stage and subsequent tests in a staging environment, it is automatically deployed to production without any human intervention.

The choice between Continuous Delivery and Continuous Deployment depends on business needs and the maturity of the team's testing and monitoring capabilities. Continuous Deployment requires a very high degree of confidence in the automated test suite.

The DevOps lifecycle is often visualized as an infinity loop, representing the continuous process of development and operations. CI and CD are the two halves of this loop, automating the flow from code to deployment.

The DevOps infinity loop, showing how Continuous Integration (CI) feeds into Continuous Delivery (CD) to create a seamless cycle of development, release, and feedback.

The DevOps infinity loop, showing how Continuous Integration (CI) feeds into Continuous Delivery (CD) to create a seamless cycle of development, release, and feedback.

To deepen your understanding of this crucial second half of the process, we'll once again turn to the "CI/CD Explained" video.

CI/CD Explained: The DevOps Skill That Makes You 10x More Valuable

This segment explains how automation extends beyond integration into the delivery and deployment phases.

Watch the part of the video covering Continuous Delivery. Then, watch the explanation that differentiates it from Continuous Deployment. Pay close attention to the role of automated end-to-end testing and the concept of having a manual approval step before production.


The CI/CD Pipeline: An Automated Assembly Line

The practical implementation of CI/CD is known as a pipeline. Think of it as an automated assembly line for software. It takes raw source code as input and, through a series of stages, produces a deployed application. If any stage fails, the pipeline stops, preventing a faulty build from progressing further.

A typical CI/CD pipeline consists of four main stages:

  1. Source: A change in the version control system (like a git push) triggers the pipeline.
  2. Build: The source code is compiled, and a deployable artifact (like a Docker image) is created.
  3. Test: Automated tests (unit, integration, security scans, etc.) are run against the artifact to validate its quality.
  4. Deploy: The validated artifact is deployed to one or more environments (e.g., staging, production).
The stages of a typical CI/CD pipeline. Each stage uses specific tools to accomplish its task. Jenkins, our focus, is a key tool in the "Build" stage, often orchestrating the entire pipeline.

The stages of a typical CI/CD pipeline. Each stage uses specific tools to accomplish its task. Jenkins, our focus, is a key tool in the "Build" stage, often orchestrating the entire pipeline.

As you can see, Jenkins is a central tool in this ecosystem, acting as the automation server that runs and manages the pipeline. Your familiarity with Git and Docker will be valuable here, as they are fundamental tools in the "Source" and "Build/Deploy" stages, respectively.

For a more detailed, professional breakdown of the pipeline's architecture and stages, the following article is an excellent resource.

CI/CD Fundamentals: Concepts Every DevOps Engineer Must Know

This article provides a professional perspective on pipeline architecture and its step-by-step execution.

First, read the section on Pipeline Architecture to understand the core components. Then, read the detailed Step-by-Step Walkthrough, which describes the journey of code from the source stage all the way to verification and monitoring in production.


Conclusion

In this lesson, you've established the foundational knowledge of CI/CD, the driving force behind modern DevOps. You now have a clear mental model of the problems it solves and the principles that guide it.

Here are the key takeaways:

  • Continuous Integration (CI) is about frequent code integration and automated testing to provide rapid feedback and maintain a stable codebase.
  • Continuous Delivery (CD) extends CI by automating the entire release process, ensuring that the application is always in a deployable state. Continuous Deployment takes this a step further by automating the final deployment to production.
  • The CI/CD Pipeline is the automated workflow that orchestrates these practices, typically involving Source, Build, Test, and Deploy stages.
  • Jenkins is a powerful and widely used automation server that acts as the engine for building, orchestrating, and managing these pipelines.

You've learned the "what" and the "why." In the next lesson, you'll begin the "how." We will move from theory to practice as you install Jenkins on a Linux server and perform the initial configuration, taking your first hands-on step toward building pipelines from scratch.