How jenkins continuous integration works

Reprint https://www.cnblogs.com/liyuanhong/p/6548925.html snippet  

Here is to choose Gitlab as the git server. The functions of Gitlab are similar to those of Github, but it is open source and can be used to build a private git server. It also provides a very powerful web GUI. For example, it is very convenient for developers to review source code with each other.

The workflow of the system is roughly divided into the following steps:

1> The developer pushes the new version to the git server (Gitlab).

2> Gitlab then triggers a build on the jenkins master node. (via web hook or timing detection)

3> The jenkins master node assigns the build task to one of several registered slave nodes, and the slave node builds according to a pre-set script. This script can do many things, such as compile, test, generate test reports, etc. These tasks that need to be done manually can be handed over to Jenkins.

4> We need to compile in the build, here the distributed compiler distcc is used to speed up the compilation.

notes

The working principle of jenkins is to first copy the source code from gitlab to the local, and then build it according to the set script. We can see that the key to the whole system is the build script, which is used to tell jenkins the tasks that need to be performed in an integration.

But I used Github as the git server later. But in fact, it’s almost the same. Let’s talk about it first, and the focus and difficulty are on the installation and configuration of jenkins later.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325198970&siteId=291194637