Apr 28, 2022

A Simple Definition of the CI/CD Pipeline

A Simple Definition of the CI/CD Pipeline

Continuous Integration / Delivery / Deployment is a method to deliver much faster updates to end-users by introducing automation into the stages of software development.

In the past, developers in charge of a feature would often work in isolation for weeks — if not months — before merging and integrating their completed work into the master branch and eventually deploying it to production.

By the time they would try to integrate their code, the branch’s code upon which they originally based their work on would have shifted so much, that merging these new changes would often prove very challenging and time-consuming, resulting is what is sometimes referred to as the "merge hell".

This would ultimately lead to code conflicts and bugs being accumulated for a long period of time without correction, making it almost impossible to deliver product updates quickly.

To solve that issue, developers came up with an automated software release pipeline that combines continuous integration, delivery and deployment often abbreviated CI/CD.

Continuous Integration

The first step of this release pipeline is called Continuous Integration.

Continuous Integration, is the practice of automating the integration of frequent code changes from multiple developers into a central repository like Git, where builds and tests are ran in order to assert the new code’s correctness before integration.

As Continuous Integration is intended to be used in combination with automated tests, it is often coupled with a software development process called Test-Driven Development.

Now, here’s how the Continuous Integration workflow looks like in practice:

  • Developers build, run and test the code in their own local environment on their workstation, before committing the code changes to the central repository.
  • Every time new code is committed, the CI service picks up the changes and automatically builds the project.
  • If the build is successful, unit tests and integration tests are ran to immediately surface any errors.
  • Finally a detailed report is sent to the team with the number of successful builds, the number of tests ran, etc.

Let’s now move on the next phase of the release pipeline called continuous delivery or deployment.

Continuous Delivery vs Deployment

Even though Continuous Delivery and Continuous Deployment sound very much alike, are both abbreviated CD and are designed to achieve the same goal, they differ on one point.

Continuous Delivery

Continuous Delivery expands upon Continuous Integration as its goal is to package the tested code into an artifact — also called a build — that can be deployed at any time through manual releases — in other words, pushing a button — either in a staging or a production environment and usually in that order.

Here, deployment simply means: distributing the software build by moving it to public servers or to another mechanism of distribution, like an app store for instance.

Why in that order? Because Unit Testing or Integration Testing are rarely enough to assert that a release works properly.

Finally, they’re usually completed with manual smoke tests or acceptance tests, performed by a quality assurance member of the team on the staging environment — which configuration is usually a replica of the production’s one or at least as close as possible — before being release to the end-users.

Continuous Deployment

In contrast, Continuous Deployment goes one step further in the sense that the release of a build to end-users is automatic if none of the previous tests are failing, and therefor doesn’t require human intervention.

Which can be an excellent way to accelerate the feedback loop with your customers and take pressure off the team, since there’s no need for release dates anymore as the code is automatically deployed as soon as it’s ready.

However, this fully-automated release process is only possible if your team already did the heavy DevOps lifting by carefully setting up each stage of the pipeline.

We can therefore say that Continuous Deployment requires Continuous Delivery.

Conclusion

In conclusion, the CI/CD pipeline is a powerful combination of automation tools to build, test and deploy code, that drastically improves its quality and makes the integration of new features blazing fast.

Related posts