[Introduction to continuous integration knowledge]

1. Introduction to Continuous Integration

Continuous integration (CI for short) is a software development practice that allows teams to receive feedback and improve on the basis of continuous integration, without having to wait until later stages of development to find and fix defects. Of course, it should be understood that the establishment of a continuous integration environment is not done once and for all. As the complexity of software projects increases, the continuous integration environment must also be maintained to ensure the reliability of the integrated environment.

 

2. The value of continuous integration

reduce risk

Integrating multiple times a day and doing the corresponding tests is helpful for checking for defects, understanding the health of the software, and reducing assumptions.

Reduce repetitive processes

Reducing repetitive processes saves time, expense and effort. Easier said than done. This time-wasting duplication of effort can occur at any point in our project activities, including code compilation, database integration, testing, review, deployment, and feedback. Through automated continuous integration, these repetitive actions can be automated without too much manual intervention, allowing people to spend more time on mental, higher-value things.

Generate deployable software anytime, anywhere

Continuous integration allows you to release deployable software at any time. From the outside world, this is the most obvious benefit of continuous integration, and we can talk a lot about improving software quality and reducing risk, but for customers, deployable software products are the most real assets. With continuous integration, you can often make small changes to the source code and integrate those changes with other code. If there is a problem, the project members will be notified immediately, and the problem will be fixed as soon as possible. Without continuous integration, these problems may not be discovered until the pre-delivery integration test, which may lead to delayed product release, and new defects may be introduced while rushing to fix these defects, which may eventually lead to Project failed.

Enhance project visibility

Continuous integration allows us to notice trends and make effective decisions. Without real or up-to-date data to back it up, the project would run into trouble and everyone would come up with his best guess. Often, project members collect this information manually, which is burdensome and time-consuming. Continuous integration can bring two positive effects:

(1) Effective decision-making: Continuous integration systems provide timely information for project construction status and quality indicators, and some continuous integration systems can report functional completion and defect rates.

(2) Notice trends: Due to frequent integration, we can see trends such as build success or failure, overall quality, and other project information.

Build team confidence in developing products

Continuous integration can build the confidence of the development team in the development of the product, because they clearly know the results of each build, they know the impact of their changes to the software, and the results.

 

 

 

3. Continuous integration elements

1. Unified code base

2. Automatic build

3. Automatic testing

4. Everyone commits to the codebase trunk every day

5. After each code submission, a build will be triggered on the continuous integration server

6. Guaranteed fast builds

7. Automated testing to simulate production environments

8. Everyone can easily get the latest executable application

9. Everyone knows what's going on

10. Automated Deployment

 

 

4. Important elements of continuous integration

1. Unified code base.

2. CI Server

3. Scripts to automate tests and builds

4.Slaves

Process of continuous integration: The CI server controls the entire process of continuous integration, polls the code base for updates, builds projects according to predefined scripts, and the server assigns tasks to the slave. This is the whole process of continuous integration. We need to formulate a complete continuous integration solution according to our project requirements, and then select the CI server and version management software according to the solution. Our project chooses the continuous integration environment of Jenkins+Github. This is what I want to tell you mainly.

 

 

 

5. Principles of continuous integration

1. All developers need to do a local build on their local machine before committing to the version control repository to ensure that their changes do not cause continuous integration to fail.

2. Developers commit code to the version control repository at least once a day.

3. The developer needs to update the code from the version control repository to the local machine at least once a day.

4. A dedicated integration server is required to perform integration builds, and multiple builds are performed every day.

5. Every build must pass 100%.

6. Each build produces a release-ready product.

7. Fixing failed builds is a top priority.

8. Testing is the future, and the future is testing

 



 

 

 

6. Why choose Jenkins

Jenins is a very popular continuous integration CI server, which also has a great relationship with its predecessor Hudson. Jenkins is easy to install, does not require database support, configures directly through the web interface, and integrates RSS/Email notification mechanism , supports distributed builds, and has rich plugins, these are the advantages of Jenkins compared to other continuous integration servers.

The choice of version control software depends on the needs of the project. It may be SVN or Git. Generally speaking, Jenkins provides plug-in support. Let's explain the details of the Jenins+Github continuous integration environment.

The main process of building this continuous integration environment is that Jenkins will run in the background, polling the version-controlled repository, and when a change is found in the version repository, the project will be built through a predefined build script, and Jenkins will build the project according to the needs of the project. The tasks are assigned to the Slave side. The general project construction process is mainly divided into two stages: automatic compilation and automatic testing, which are also the stages where your script plays a role.

 

Jenkins is an open source software project that aims to provide an open and easy-to-use software platform that enables continuous integration of software. Jenkins is a visual web tool widely used for continuous construction. To put it more bluntly, continuous construction is the "automatic" compilation, packaging, distribution and deployment of various projects. Jenkins can well support project construction in various languages ​​(such as java, c#, php, etc.), and is also fully compatible with ant, maven, gradle and other third-party build tools, and can be seamlessly integrated with svn and git. Support direct integration with well-known source code hosting websites, such as github and bitbucket.

,jenkins itself is developed in java language, so the machine to install jenkins must have at least jdk, and it is recommended that git, ant, maven, gradle, groovy and other tools are also installed together to facilitate integration with these build tools.

 

Jenkins is a continuous integration tool developed based on Java for monitoring continuous repetitive work. The functions include:

1. Continuous software version release/test project.

2. Monitor the work performed by external calls.

 

 

7. The relationship between Jenkins and Hudson

Jenkins was formerly known as Hudson (developed by Sun), which was forked from Hudson in 2010. Because Sun was acquired by Oracle, which claimed ownership of the Hudson trademark, the former was forced to do so. The forked Jenkins will continue to follow the open source road, while Hudson may be used for commercial purposes, both of which continue to be developed

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327072273&siteId=291194637