What is Jenkins?
I have been hearing from many DevOps engineers I know they have been using Jenkins for continuous integration. Then I decided I need to understand this tool for sure as it is so popular among these engineers. There must be something that is making their work easy and profitable.
I began my research on various continuous integration tools available in the market. Buddy, Bamboo CI, Team City, and many more were the results of my search. But after a thorough study, I realized Jenkins is the most extensively used in 2020. There I began my search to get a better understanding of the tool.
This is where I took help and enrolled for the most trusted software training institute, 3RI Technologies, that offered me this course at a reasonable price. Here I am to share my learnings, and I hope you understand what Jenkins is and its features.
What is Continuous Integration?
CI is the abbreviation used for Continuous Integration. It is a process by which all the developer’s code is committed to the repository shared among them. This is not done only once, but every time a change is made in the code. Once a commit is done to the repository, then a build is run. This brings early detection of an error. Depending on the CI’s tool, an application may be deployed on test servers after the build. The test results can then be shared with the developers. Grady Booch first introduced this concept in 1991.
What is Jenkins?
Jenkins was a creation of Kohusuke while he was working with Sun Microsystems. He needed a system where he could test his piece of code before he commits it. This led to the invention of Jenkins. This could save more time and hassle involved during development. It is a free source powerful tool used for continuous integration.
It is a crucial tool to automate the entire process of the delivery cycle for any software. The Jenkins tool can easily be connected to several testing and deployment systems.
Jenkins can be used in almost all industries for automating the development cycle. It can integrate with the various development processes like building and deploying a package, testing a package, documenting and analyzing statistics, and so on.
Features of Jenkins
- Easy to install Jenkins software: You can begin your Jenkins package download by visiting https://www.jenkins.io/download/. Once the download is complete, you can quickly start with the installation process by following the screen’s instructions. You can also install the latest Jenkins version on your cloud platform.
- Easy to configure: The web interface of Jenkins can be used to configure it. You can use the inbuilt help functions or error checks while configuring the Jenkins tool.
- Easy to extend: The Jenkins tool can be quickly developed by using its plugins. We can do more things using Jenkins.
- Easy to distribute: With the Jenkins tool, easy distribution across different platform machines is possible for the build, deployment, and testing purposes.
- Open Source: It is open-source software. As a result, around 1 million users are using the Jenkins tool.
- Several plugins available: 1000+ plugins are available in the Update Center. They can be integrated with almost every tool in the Continuous Integration and Continuous Development chain.
2004: Kohsuke Kawaguchi was a Java developer who had developed Hudson while working in Sun Microsystems to ease his continuous building and fix errors in the code.
2007: Hudson was considered as a better option than Cruise control.
May 2008: Hudson won an award in solutions for the developer category at Duke Choice Award.
2010: Oracle acquired Microsystems.
2011: O’Reilly awarded Kohsuke Kawaguchi Open-Source Award.
Jan 2011: Hudson of Microsystem was renamed to Jenkins.
April 2016: Jenkins 2.0 was released with the default enabled Pipeline plugin.
Feb 2017: Jenkins replaced Hudson of Oracle in Eclipse.
2018:Jenkins X project was presented for Kubernetes.
2019: Jenkins had 2200 public repositories and 667 members against Hudson with 20 public repositories and 28 members.
Why use Continuous Integration using the Jenkins tool?
Let us consider 20 people who are working on a project. All people have a different pace at which they are working. Some complete a given task in 10 days while others complete the job in 20 days. The maximum no of days for all developers to finish the task is 25 days.
The scenario when Jenkins was not used
In this case, the code would have been committed only after 25 days when they finished their code changes. Then it would be built, deployed, and tested. This would have resulted in the loss of many working days for some developers. It was also not easy to detect errors that might have committed after all commits on the same day. The process was manual, so this increases the chance of its failure. Once all the errors have been fixed and tested, it was deployed again. This slowed the process of development.
The scenario when Jenkins is used
In this case, each developer will commit its code. The Jenkins tool will build that code, deploy it on the test server, and send the developer’s test results. This activity is repeated for every commit made. Even if the build fails, the error report is sent to the developer. An individual developer commits the code, and the build is run. So it is easier to detect any error in the code. The development process is automated, saving time. This increases the profit of the organization.
Real-world case study of continuous Integration
This case study is about a well-known mobile network company Nokia Networks. Here we will be studying the software product for telecommunications developed by them. This is used for managing the infrastructure of the network.
It is a modular Java application with a web interface for administration. Products are installed at the customer site by skilled labourers.
The product is developed on a large scale with developers working from different locations. Initially, they used to implement a nightly build procedure. As per this procedure, the build was carried out at night when the product’s use was minimal to speed the build process. During the day, all developers could commit their code and build once at night. This made it difficult to recognize the errors made by a developer during the day.
Then in 2014, they adopted Jenkins CI. It had two systems: a build server and the other one provides resources for carrying out the build process. The code is committed to the GIT repository after every code change. The Jenkins server will then check the repository for the commits made and then build the code and deploy it on the test server. If the test results are satisfactory, it is then deployed on the production server. Also, the test results are shared with the developer, and in case of any error, the developer makes the necessary changes. This is a continuous process and increases productivity for the company as it detects an error at an early stage of the development cycle.
Advantages of using Jenkins
- Jenkins has an open community that takes feedback from their customers every month regarding any issue they face. This feedback helps in the further development of the Jenkins tool.
- Around 280 tickets raised by customers have been closed. Jenkins releases a stable version every three months.
- 300+ plugins are already published in Jenkins Update Center and making it robust.
- The Jenkins tools can be deployed in any cloud environment.
- It is available at no cost.
- Its source code is in Java. Thus it can be easily ported to different platforms.
The disadvantage of using Jenkins
- Its web interface is not user friendly if we compare it with newer trends in UI.
- We need skilled administrators who can work on the Jenkins server, so it isn’t easy to maintain.
- Small changes in setting can pause the process of Continuous Integration. This then needs the attention of developers.
How to install Jenkins?
Installing Jenkins Server on Ubuntu, a distribution of Linux
Visit https://www.jenkins.io/doc/book/installing/#debian-ubuntu to install a Ubuntu package that will install Jenkins and configure it as a start service. This download will create a /etc/init.d/Jenkins script, which will run the next time the system boots in.
Installing Jenkins Server on Windows machine
Visit https://www.jenkins.io/download/ and click on Windows package for download. It will download the Jenkins.msi file in your download folder.
Below are the minimum requirements to start Jenkins installation.
256MB RAM and 1GB space in hard disk are needed in your laptop or computer where the Jenkins tool needs to be installed. Also, you need the latest version of JRE and JDK on your system. You also need to have JDK/JRE 8-64 bits or JDK/JRE 11 -64 bits.
Click on the file to start with the installation process. Provide the credentials of the account that needs to be used to run the service. Once done, test the credentials and proceed.
Then select the port and test the port for service.
Select the home directory of Java.
Click Next to continue the installation. Click on Finish to finish with the installation.
How to start Jenkins using Command prompt?
- Go to the Search tab present at the bottom of the taskbar.
- Type cmd. The command prompt window will start.
- Now go to the directory where Jenkins. The war file is present.
- Run the command “Java -jar Jenkins.war.”
- Winestone, an embedded Web server, will then extract the war files along with other tasks.
- If you receive a few or no errors, it will show the message,” Jenkins is up and running.”
- To access the link in Jenkins, you need to type “-http://localhost:8080”. This will bring the dashboard for Jenkins up.
The architecture of Jenkins
Jenkins has master-slave architecture where they communicate through TCP/IP protocol.
The main Jenkins server is the Jenkins Master, Which handles
- Scheduling and dispatching build jobs to Jenkins slave for successful execution.
- Monitoring the Jenkins slave
- It records and presents the build results.
- It can also directly run the build jobs.
Jenkins slave is an executable in Java running on a remote system. Below are the task performed by the Slave machine.
- It takes the build job instructions from Jenkins Master. It merely follows the instruction of the Master.
- It can be used to run on different operating systems.
- A project can be configured to run on a particular Jenkins slave or run on the available Jenkins slave machine.
How is Jenkins used for running tests in different environments?
Jenkins continuously checks the GIT storehouse for any code change. For every code change, it deploys the code on different slave machines and runs the tests. Jenkins Master will schedule a job to build and execute them. It is then deployed on the next available Jenkins slave. The Jenkin slave will generate test reports which are passed to the developers for verification.
What is a pipeline in Jenkins?
Jenkins pipeline is used to find out which task is executed at a given moment. Many developers are constantly making code changes that are committed to the GIT repository. So the pipeline helps us know which changes are tested, or which change is in the queue, or which build has generated errors. The Jenkins pipeline will tell us the status of each test.
Build pipeline consist of sections like the unit and acceptance testing, packaging and deployment, reporting phases. The sections in a pipeline are executed serially or parallelly. If one stage of the pipeline is completed, it proceeds to the next step.
What are the different types of build jobs in Jenkins?
These jobs can be used for general purposes. It is a flexible job that can be used for different projects. It is simple to configure these kinds of jobs. Also, several features that are set up in this job are available while using other jobs too.
Matrix projects allow the same build job to run in different environments. These jobs can be used to test applications in different environments and databases. You can also try them in different environments for the build.
Monitor an external job
This job is used to look after non-interactive processes like cron jobs.
These jobs are designed explicitly for Maven projects. Jenkins has an understanding of pom files and the project structure in Maven. This will help in reducing the work done to set up a project in Maven.
What are the different ways to authenticate users in Jenkins?
Jenkins authorizes the user information with its user id and password while trying to access the database.
It uses the Lightweight Directory Access Protocol.
Authentication techniques are used on the application server before the code is deployed.
What are the different job opportunities available after learning from the Jenkins tutorial?
If we check for various job opportunities available after learning, Jenkins is around 8000+ on Naukri.com.
The average salary for any build and deployment engineer skilled in Jenkins is Rupees 6lakhs.
Learning the Jenkins tool can give accelerate your career growth. It is ideal for people looking to start their career in DevOps. It is also a good chance for people looking for a transition in their career cycle.
If you find this blog useful, I would suggest you enrol yourself for a Jenkins- DevOps Training at 3RI Technologies, pioneers in Jenkins online and offline Training in Pune. They have a team of expert faculty and a holistically designed curriculum Jenkins tutorial. They will also help you with all the necessary Jenkins software installation. Every class will have interactive rounds of quizzes and assignments to work on. The interaction with other students during their LIVE class will help you develop a better understanding. During a live interaction, you will get to clear your doubts. Also, you will get to learn from other student doubts.
The LIVE projects that you will be working on will be fun to work on. This will give you a practical understanding of the various concepts in Jenkins. Also, you will understand the different situations that you might face when you join a company.
They have an excellent placement cell, which provides ample job opportunities, which will help us find the job we have been looking for. DevOps Online Training will help you.
Thanks for reading my blog and happy learning, Jenkins.