When you work as a team on the same project, it is important to know how to organise yourselves in order to be efficient and deliver a working project on time. The CI/CD approach makes it possible to reduce the time spent going into production. It is invaluable help for carrying out unit and functional tests in an automated way. This approach is an integral part of DevOps — if you have not yet read our article on the subject, we invite you to take a look.
The concepts behind CI/CD
When we talk about the CI/CD approach, we are referring to 3 concepts: Continuous Integration, Continuous Delivery and Continuous Deployment.
CI/CD is an approach that adapts very well to the needs of each web or software project. Indeed, the approach is modular, and in some projects it can happen that the 3 concepts are not used together. What we most often observe in those projects is that development teams favour continuous integration and continuous delivery without using continuous deployment, thereby keeping control over that final step.
Each team adapts the CI/CD approach to each project, with the tests, automations and deployments that are needed.
The different approaches
Continuous Integration (CI)
The principle of continuous integration rests on how frequently the code of the various developers is merged. Whether for a simple modification or for adding a new feature, the aim is to work as a team on files that are updated regularly. This makes it possible to test the code and detect errors quickly.
These tests are predefined by the DevOps engineer and fully automated. So every time a developer submits a merge request, the tests check the code and make sure there will be no malfunction. In the event of an error, the test that did not pass can be identified by the developer, who can then make the necessary changes.
Continuous Delivery (CD)
Continuous delivery makes it possible to automate the publication of code to a pre-production (staging) branch, provided that the code has first been validated by the automated tests.
This publication automation can involve additional tests, again defined by the DevOps engineer. Thanks to this approach, it becomes easier and faster to deploy the project into a production environment.
Continuous Deployment (CD)
Continuous deployment makes it possible to automate the publication of code from the pre-production branch into production.
Other tests can be defined by the DevOps engineer in order to make sure that the deployment goes ahead without errors. In this way, every change made to the project is automatically delivered to the client, provided the tests pass.
The benefits of the CI/CD approach
Setting up a CI/CD approach can prove complex at the outset, because you have to manually write all the tests the project will need. However, once that step has been completed, many benefits follow.
Automating the tests allows faster release to production and faster deployment. Detecting bugs through the various levels of testing makes them easier to fix. The code therefore stays clean and stable.
The CI/CD approach encourages constant evolution within projects, because every change is integrated, tested, delivered and then deployed step by step.
If you enjoyed this article, do take a look at our DevOps section.