Continuous Integration (Jenkins)

What is continuous integration

Continuous integration (CI) refers to the frequent (multiple times a day) integration of code into the backbone.
The purpose of continuous integration is to allow products to iterate quickly while maintaining high quality. Its core measure is that the code
must pass automated testing before it is integrated into the backbone . As long as one test case fails, it cannot be integrated.
Through continuous integration, the team can quickly go from one function to another. In short, a large part of agile software development is due
to continuous integration.
Insert picture description here
According to the design of continuous integration, the entire process of code submission to production has the following steps.


The first step in the submission process is for the developer to submit the code to the code repository. All subsequent steps start with a
commit of the native code .

The test (first round)
code warehouse is equipped with a hook for the commit operation. As long as the code is submitted or merged into the trunk, automated tests will be run.

Build
After the first round of testing, the code can be merged into the backbone, even if it can be delivered.
After delivery, first build (build), and then enter the second round of testing. The so-called construction refers to the conversion of source code into actual code that can be run, such as installing dependencies, configuring various resources (style sheets, JS scripts, pictures), and so on.


After the completion of the test (second round) construction, the second round of testing must be carried out. If the first round has covered all the test content, the second round can be omitted, of course, at this time the construction steps should also be moved to the first round of testing.

Deployment
After the second round of testing, the current code is an artifact that can be deployed directly. Pack all files of this version (tar filename.tar *) and archive them to the production server.

Rollback
Once a problem occurs in the current version, it is necessary to roll back to the build result of the previous version. The easiest way is to modify the symbolic link to point
to the directory of the previous version.
Insert picture description here

Jenkins

Insert picture description here
Jenkins is a popular open source Continuous Integration tool, which is widely used in project development and has functions such as automated construction, testing, and deployment. Official website: http://jenkins-ci.org/.


Features of Jenkins:

1. Open source Java language development continuous integration tools, support continuous integration, continuous deployment.
2. Easy to install, deploy and configure: It can be installed through yum, or downloaded war package, and quickly installed and deployed through docker container, which is convenient for web interface configuration management.
3. Message notification and test report: integrate RSS/E-mail to publish the build result through RSS or notify by e-mail when the build is completed, to generate JUnit/TestNG test report.
4. Distributed build: support Jenkins to allow multiple computers to build/test together.
5. File identification: Jenkins can track which build generates which jar, which build uses which version of jar, etc.
6. Rich plug-in support: support extension plug-ins, you can develop tools suitable for your team, such as git, svn, maven, docker, etc.

Guess you like

Origin blog.csdn.net/weixin_41237676/article/details/114136081