Continuous Integration and Continuous Deployment

Introduction

The speed and quality of product assembly are the main competitive advantages in software development. Therefore, a new concept of CI/CD — Continuous integration and Continuous delivery – continuous integration and continuous delivery - began to replace archaic programming models, such as imperative, structural or modular. It helps to minimize errors, increase the pace of assembly and the quality of the product being developed.

What is CI/CD

CI/CD is one of the DevOps practices that implies continuous integration and delivery. This set of principles is designed to improve the convenience, frequency, and reliability of deploying software or product changes. CI/CD refers to agile practices and allows developers to pay attention to the implementation of business requirements, code quality and product security. CI/CD Goals: providing a consistent and automated way to assemble, package, and test products or applications;automation of deployment in different environments; minimizing errors and problems.

CI/CD Principles

There are four guiding principles for CI/CD.

1)Division of responsibility. Each of the participants in the process shares responsibility for certain stages of the product life cycle. Business logistics is being designed, end-to-end functions are being implemented, acceptance tests are being conducted and code logistics is being organized.

2)Risk reduction. Each team involved in product development strives to reduce risks — the correctness of business logistics is monitored, user experience is checked, data storage and processing are improved, and so on.

3)Shortening the feedback loop. The developer and the client should strive to increase the speed of making changes and approving edits. Code assembly and testing can be automated. And for situations where human participation is required, it is possible to minimize the number of information intermediaries.

4)Implementation of the environment. Developers should have a common workspace with the main and auxiliary branches for version control and quality, acceptability, fault tolerance, etc.

CI/CD Stages

The CI/CD methodology involves dividing the development process into seven stages.

1)Writing code. Developers write the code of their module and conduct manual testing. After that, the result of the work is connected in the main branch with the current version of the project. After all the module codes are published in the main branch, the second stage begins.

2)Assembling. The selected version control system initiates the automatic build and subsequent testing of the project. Triggers for activating the build can be configured independently. Jenkins or another tool is used to automate the assembly.

3)Manual testing. After the CI system checks the operability of the test version, the code is transmitted for manual investigation.

4)Release. After manual testing, corrections are made to the assembly. Next comes the release of the code version for customers.

5)Deployment. At this stage, the current (working) version of the code is hosted on the developer’s production servers. The client can interact with the program and learn its functions.

6)Support and monitoring. The product begins to be used by end users. At the same time, the developers continue to support it and analyze the user experience.

7)Planning. Based on user experience, new functionality is being developed and a plan of improvements is being prepared. After that, the developer starts writing code — and the cycle closes.

Pros and cons of CI/CD

The minimum time from the client’s request to launch into use. The methodology reduces the time for launching updates to several days (in some cases, weeks). Thanks to this, developers get the opportunity to test innovations faster and implement solutions faster than competitors.

The ability to check options. Operational testing and many iterations help the developer to quickly identify options that have no prospects, even at the initial stages.

The quality of the result. Conducting automated testing helps to identify errors and other problems at the earliest stages of development. With the standard release approach, this is difficult or impossible to do.

Experience requirements. In theory, all corporate IT systems can be transferred to CI/CD. But in practice, to get a result, you need primary experience with the methodology, as well as the correct organization of the restructuring of all processes.

The complexity of ensuring interaction. Continuous updating and continuous delivery should be clearly coordinated, which is possible only after careful adjustment of interaction between specialists at all levels.

CI/CD — hype or necessity?

CI/CD is one of the hype software development methodologies. For the first time the idea of its implementation was announced in 2006, and already in 2008, experts expressed the opinion that its popularity is associated with the development of cloud services. At the same time, the desire to use it to solve other tasks is not due to popularity, but to the advantages of the system — the ability to quickly coordinate and implement updates based on user experience.

Result

CI/CD is not just a methodology, but also a very good tool for the development team. The longer it is planned to develop and maintain a project, the more useful it will be to have a well-designed CI/CD. All the resources and costs of this tool pay off at a distance. With its help, time-to-market is indisputably reduced, and the probability of making a mistake is also reduced. The most important thing is to keep the instrument in good condition.