Jenkins Architecture

Jenkins Architecture:

In Jenkins architecture, the process goes on as follows:

  1. Developers take the codes from the repository and make changes in code as per requirement.
  2. Jenkins master checks the repository regularly after a fixed time interval.
  3. When Jenkins gets some new executable file with new codes or some changes in the developer's previous codes, it compiles the codes instantly.
  4. After the compilation, when the server gets an error in the developer's build codes, it sends an alert message to the developer, and if the code is clean, it will deploy to the production department.

Mainly the executable files are very large in size, and it is not possible to handle multiple & large executable files by a single Jenkins server, so Jenkins uses Master-Slave Architecture to perform continuous integration and continuous deployment.

A single Jenkins server can also not perform testing in different platforms like on windows, Linux and Mac operating systems. To fulfill this requirement, you need to use Jenkins slaves. You can use many Jenkins slaves under a single Jenkins server, which is known as Jenkins Master.

Jenkins architecture is given below, but it is the architecture of single Jenkins server. You can lso relate it to Jenkin's master-slave architecture.

Jenkins Architecture

Jenkins File:

Jenkin's file gets built when we start working with Jenkins pipeline. It is a text file that contains the iteration made in the Jenkins pipeline. It is stored in the Jenkins home directory.

The syntax of the Jenkins file can be written in a scripted pipeline and declarative pipeline.

  1. Scripted pipeline syntax:  It was the first syntax written for the Jenkins file. It has high flexibility, and there is no pre-defined structure to write the code in a scripted pipeline. It follows the groovy script.
  2. Declaration pipeline syntax:  It is a recent addition in the market to write the Jenkins file syntax. It is not as powerful as a scripted pipeline syntax, but it is easier to get started because it has a predefined format to write the code.

Syntax:

pipeline {
            agent any
            stages {
                        stage (“build”) {
                                    Steps {
                                                // statements…
                                    }
                        }
            }
}

Why use Jenkins:

"Software testing" >> It is a part of the software development lifecycle. Developers try to write error-free code, and they want it to be fit in the client's requirements, so after completing a fragment of the project, they test it and run it. Jenkins helps developers in doing the same. It converts CLI into GUI easily. Thus, it makes easy to developer in debugging (even if any error occurs) also.

>> Nowadays, teams tend to centralize the platform for communication. It is also helpful in teamwork management. Every team member works on a different part of the project; Jenkins helps them to be in sync.

>> It is a tool that allows the programmer to make changes in the code during the development of the project easily. After making all the changes, it checks the code and shows the output in the Jenkins dashboard.

>> It provides accurate data support to the project management.

>> In a comparison of the normal development process, it takes less time to deliver the product in the market.