Continuous integration, continuous delivery, continuous deployment (CI/CD) in detail

CI/CD details


The general process of a complete system: product design -> developers develop code -> testers test functions -> operation and maintenance personnel release and go online.

1. Integration

In actual software development, there are often the following two scenarios:

  1. Now there is an e-commerce platform that needs to be developed. Since there are many modules on the e-commerce platform, different developers are required to develop different modules. Finally, the codes developed by everyone are integrated into one system. Deployment goes live.

  2. With the passage of time, whether the system is bug fixes or new function development, the system needs to be continuously updated and iterated.

In general: Integration is when all developers combine their own modules to form a complete system.

2. Continuous Integration (Continuous Integration)

Continuous integration refers to the frequent integration of code into the trunk (repeating the above integration work), as shown below:

image-20220319113310466

After the developer submits the new code, it will automatically build and execute the unit test (which can be done through Jenkins). The developer only needs to submit the code to get the result of this integration. According to the result, the new code and the original code can be determined. Can the code be properly integrated.

Benefits of using continuous integration:

  1. Quickly find errors, each time a little update is completed, it is integrated into the trunk, which can quickly find errors, and it is easier to locate errors.

  2. Save labor costs and automate builds with Jenkins.

  3. Accelerate software development progress.

  4. Real-time delivery.

The core of continuous integration:

Automated tests are performed before the code is integrated into the trunk. As long as one test case fails, it cannot be integrated. Of course, continuous integration does not completely eliminate bugs, but makes them very easy to find and correct.

3. Continuous Delivery

Continuous delivery refers to the automatic deployment of code to the pre-production environment (Staging) based on continuous integration, as shown in the following figure:

image-20220319112453704

The Staging environment can be understood as a mirror of the online environment ( to simulate the online environment to the maximum extent ). Testers and PMs perform the final round of verification on the final project to be deployed on the pre-production environment (Staging).

If the pre-production environment is verified, it needs to be manually deployed to the online (production) environment.

4. Continuous Deployment

Continuous deployment is the next step in continuous delivery, which refers to the automatic deployment of code to the production environment, as shown in the following figure:

image-20220319113216123

The difference between continuous delivery and continuous deployment is whether the process of final deployment to the production environment is automatic.

For development, you only need to submit the code, and nothing else needs to be done. If the code passes the test, it can be automatically deployed to the production environment.

Guess you like

Origin blog.csdn.net/weixin_49343190/article/details/123591691