Continuous Integration/ Continuous Deployment (CI/CD Pipeline) is a process adopted by software teams to deploy their product faster. Unlike traditional software development models such as waterfall, with CI/CD pipeline, the software is shipped weekly, daily or more than one time in a day! It is surprising, but the updates in the software take place without disturbing the customer, rather the customer may not realize the software being updated while they are using it.
As Software as A Service (SaaS) applications are growing, the companies are following DevOps. The software development teams are now moving towards shorter build cycles with automated check-in and deployment. Efforts to automate the testing process of the build are now put for successful DevOps operations.
DevOps basically comprises of 2 words: “Development” and “Operation”. Development is function of software developers and Operations is testing the automated build using test automation.
Terminology in CI/CD
Continuous Integration: This phase of CI/CD pipeline is collecting and integrating the work done by individual developers in a software development team. Each developer writes their own piece of code, which is then integrated and put into a common repository (e.g. GIT, TFS, etc.). This process helps in reducing the individual build costs of every piece of code. When the developer checks-in the code, he will find integration conflicts between the new code and the existing code in the repository. This in turn will help in early detection resolution of conflicts and less overhead costs. A new build version is created whenever the developers add their code to the repository. In CI the quality assurance checks require manual and automated test suites to test for any bugs in the builds.
Continuous Deployment: When changes are made to the build, the deployment of those changes occurs in the CD phase of the pipeline. This phase relies on automation testing and automated deployment process. Automated test suites are built for further automated deployment as soon as they pass through the continuous integration step in the CI/CD. An efficient CI/CD process is marked by a readily available code base in CD for automated deployment without interference.
How to set up a CI/CD Pipeline
As the build passes through automated test suites, failure of a test may notify the team to act. Otherwise, the build will continue to pass through next set of tests till it reaches the last stage of deployment. The last stage is a production like environment. In this environment, the build, deployment process and environment tests are done together. This indicates that the build is ready to be deployed in production.
This is how a CI/CD Pipeline is set up:
To test a web application, the developers will write a code which will be added to a common repository. Different versions of code exist for each piece code.
These pieces of code are then compiled and the code is built together in the build phase.
The build is automatically tested in the testing phase of the Continuous Integration Pipeline.
As the build passes the testing phase, it is now ready for deployment. In this phase a production like server is prepared where the build is tested before shipping to actual production environment.
Once successfully passing the staging production server, it is sent to the actual production server.
In case of conflict at any stage in the pipeline, the process reiterates itself with each new build version. This is a continuous process occurring weekly or daily as new functions or changes are made.
Benefits of CI/CD Pipeline
The testing occurs at various stages in the CI/CD pipeline which helps in early detection of bugs leading to less efforts, time and cost.
The feedback mechanism is faster than traditional development models as the builds are compiled and instantly tested automatically to show any conflicts in the code.
In SaaS, with help of CI/CD, the deployment process is automated without the customer needing to download any installation components. All the updates happen on the back-end while the software is operational.
Some CI/CD Tools
CI/CD tools have entered the market quite a long time ago. The process has been adopted by many organisations but most of them still haven’t. The companies can use CI/CD for internally developed applications or infrastructure and third-party applications. Some of the tools in market are Jenkins, Ansible, Spinnaker, Gitlab CI, Go CD etc.