CI/CD

Ashila Ghassani
3 min readMay 23, 2021
Photo by Pankaj Patel on Unsplash

You may have always heard about CI / CD since working on software projects but you are wondering what is CI / CD?

Definition

CI / CD is a method / technique for delivering our application to customers and this is done automatically. With the CI / CD, you can monitor continuously, from the integration phase, testing, to deployment.

CI vs CD

Continuous Integration(CI)
Continuous Integration is a technique to automatically integrate changes to code in a project. CI makes code changes from each contributor routinely merged into a shared repository through the build and test stages. CI is a solution when a project has many branches by preventing conflicts between branches.

Continuous Development
Continuous Development(CD) is the ability to store changes to code which are then passed to production quickly and easily. CD can ensure that the deployment process becomes an automated process that we can arrange whenever we want. It builds on the benefits of continuous delivery by automating the next stage in the pipeline.

Why CI/CD?

Advantages Continuous Integration(CI)
1.Detect conflicts and bugs early.

There’s a chance conflict on working software project because different changes are being made simultaneously by other developers. Therefore, Continuous integration (CI) helps developers merge their code changes back to a shared branch. Once a developer’s changes to an application are merged, those changes are validated by automatically building the application and running different levels of automated testing to ensure the changes haven’t broken the app. That means testing everything from classes and functions to the different modules that comprise the entire app. If automated testing discovers a conflict between new and existing code, CI makes it easier to fix those bugs quickly.

2. Speed up the process
CI can reduce the time we spend on testing compared to manual testing. It happened because CI runs tests automatically on the entire project.

Advantages Continuous Delivery(CD)
1. Improve software quality
CD makes the deployment process automatic or not repeated. Therefore, developers can have more time to improve software quality by doing usability testing, performance testing, refactoring, etc.

2. Users can reach products more quickly.
CD makes all processes done automatically. Therefore, the process of implementing and detecting bugs or conflicts can run more quickly so that clients can reach products more quickly.

Implementation CI/CD

Our team uses CI / CD from Gitlab in our project development. There are 4 stages on our project (lint, test, sonar-scanner test, deploy-to staging). But for the master branch, there is an additional stage, namely deploy-to-production.

At this stage, we will try to set up CI / CD on GitLab. To create a CI / CD in GitLab, create a file in the project root with the name .gitlab-ci.yml, then set the configuration as needed in the project.

Here is the CI / CD script our team use:

Reference

https://www.redhat.com/en/topics/devops/what-is-ci-cd

--

--