Introduction to CI/ CD

Sep 09, 2021

What is CI/CD? What does it stand for?

In CI/CD as known as CICD, CI stands for Continuous Integration, In here, developers regularly merge code changes into a shared repository where automated builds and tests run. As well as, CD either means “Continuous Delivery or Continuous Deployment. It is a widely used abbreviation in DevOps
CICD is a DevOps approach that utilize proper tools to accelerate the deployment. So, it facilitates our Agile Software Development. The difference between CICD and DevOps is, CICD focuses on the tools which emphasize the automation of SDLC (Software Development Lifecycle). On the other hand, DevOps focuses on the tools which emphasize the responsiveness of culture underscoring functions.

Continuous Integration

This is the first step in CICD. The procedure of how CI works is, developers frequently push their codes to a repository often on a daily basis. It could be GitHub, Codecommit, Bitbucket and so on. As soon as the code is pushed, there will be a testing. Build server checks the code immediately after it is pushed. The reason they do this is, to ensure whether the code runs correctly without bugs. In this approach developers can get a feedback about the tests and checks that have passed or failed, and they can improve the code. By following this method, developers can find bugs early and fix those very as well. As a result of that we can deliver the code faster as it is tested continuously and then deploy often. Advantage of using CI is, developers don’t have to run the tests of codes by themselves. All they have to do is to push the code to a code repository. And then the build server will do a massive job by “testing the code” , “building it”, and sometimes even notifying the developer how it works.

Continuous Delivery

Continuous Delivery ensures whether the /project/software can be released accurately at any time needed. Also it assures the deployments happen very often and quickly. It means the deployment will be fully automated. There are technology available such as CodeDeploy, Jenkins CD, Spinnaker and etc.

Continuous Delivery Pipeline:

Continuous Delivery Vs Continuous Deployment

Continuous Delivery:

  • Capability of deploy often using automation
  • May includes  manual steps to approve a deployment
  • The deployment is still automated and can be repeated by itself.

Continuous Delivery:

  • Fully automated. Every code change you do in the source repository, will be deployed all the way production.
  • No manual intervention of approvals.

Continuous Delivery and Continuous Deployment are very similar to each except Continuous Delivery may involves some manual steps or as concerns, Continuous Deployment is automated all the way to pushing to production.

Technology Stack for CICD

Let’s take an example….

Assume that you and a friend start a new project together. You are the Backend developer, and you have to work on about the API part. Simultaneously your friend, the Frontend developer works on a new UI. You are working on a same repository but in different branches. This single branch is usually called the “trunk.”. After working for a while when it comes to merge the features, you found that they are completely incompatible, and build fails. If that happened, you have to pay extra time and resources to resolve those conflicts.

What if you used Continuous Integration pipeline?

Let’s find out how it prevents issues like that….
To deliver the project to the clients, you need to run these commands.

  1. TEST
  2. BUILD
    You can automate this entire process in the cloud by using a CI server. Ex: GitHub actions
    First of all, you have to create a workflow and command it to run on every push to the master branch. This incident drives a task that runs on a Linux container in the cloud. (such as  Docker). After that  command  the container what to do as a series of steps.
    Then it checks the code in the GitHub repository  and sets up node.js . Install the dependencies and runs the test., build and deploy commands.
    Thereafter anytime you commit to the master branch in that repository, it will run this workflow.
    If any of the steps failed, the ineffectual project wont deliver to the client and we will automatically know there’s an issue needs to be figure out.

CICD offers two main benefits.

  1. Helps developers to automate things  otherwise they have to done that manually.
  2. Increases the velocity, and detects little issues occurred before they grow into major disasters. The result of that is a higher quality code.
Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.