CI/CD: It all starts with a push!

CI/CD: It all starts with a push!

A beginner's guide.

Let’s start with a real-world example of online shopping at your favourite app to understand CI/CD!

Phase 1: Placing Order--> Integration You liked few items- let’s say item A, item B and item C, added these to the cart and placed an order. All the items in the shopping cart were integrated under a single order number when you placed an order. This is the integration phase.

Phase 2: Quality check and shipment--> Delivery After the successful placement of your order, the seller inspects and does quality checks of the items, verifies items against the order you placed and stow it for delivery if everything goes fine. You wait for the packages to arrive and coordinate with the courier service to confirm the location. This is the delivery phase.

Phase 3: Deployed to use--> Deployment Once packages arrived, you opened and reviewed its content to ensure it matches the expectations. If it does, you’re ready to use the items newly purchased, if it doesn’t you reject and returns them. This is the deployment phase.

Hope you were able to relate!

CI/CD is an agile practice that enables the development team to implement small changes and deliver them to the production environment with quality, speed and reliability.

CICD process by Nivedita Rani.png

“CI” in CI/CD refers to Continuous integration. It works in three simple stages: push, test, and fix. So, a developer:

  1. Writes code.
  2. Performs unit testing in local or development environment.
  3. Commit and push their code into the remote version control repository. E.g.- GitHub, Bitbucket etc.
  4. If the integration succeeded, the new code changes to the application were merged to the master /other branches depending on the process the development team follows.

Benefits of CI:

  1. Developers detect and locate errors at early stages.
  2. Managing the resolution of code conflict between multiple developers’ code changes becomes easy.
  3. A better understanding of the codebase and the features being developed for the end-users.

“CD” in CI/CD refers to Continuous Delivery and Continuous Deployment. It’s used interchangeably but they aren’t the same. Continuous Delivery is an extension of CI. After the successful CI:

  1. Version control repository is integrated with build tools like Jenkins, Hudson, Harness etc. and runs a set of automation tests/ code quality checks to confirm that the newest code pushed meets code quality standards.
  2. If the automation test fails or test execution reports are unsatisfactory, the broken build becomes the highest priority to fix before continuing to add further features.
  3. Once these tests are passed, then code changes are marked as a release-ready package and maintained in repositories like Nexus, Artifactory etc.

Continuous deployment goes one step further than continuous delivery. In this practice, release packages are automatically or manually released on scheduled date from the repository to production, where it is usable by end-users.

Benefits of CD:

  1. Helps increase the reliability of the new releases.
  2. Releases are more often which accelerates the feedback loop with the users.
  3. Frequency in improved quality of the application.
  4. Fewer chances for rollbacks, as changes are tested thoroughly in the integrated code base in different stages.

A good CI/CD strategy is important as it makes developers confident of their work knowing that errors or any conflicts would be caught early and automatically and not right before deployment.

I hope this blog would have helped you to understand the cooperative process of CI/CD, the benefits it brings and the challenges you might encounter.

Happy Coding!

Feel free to post your questions/ comments and connect with me on LinkedIn: https://www.linkedin.com/in/nivedita-rani/