DevOps Certification Training Course
- 121k Enrolled Learners
- Weekend/Weekday
- Live Class
Jenkins is one of the most important tools in DevOps. I hope you have read my previous blog on What is Jenkins. In this Jenkins Tutorial blog, I will focus on Jenkins architecture and Jenkins build pipeline along with that I will show you how to create a build in Jenkins.
Before we proceed with Jenkins Tutorial, the key takeaways from the previous blog are:
Now is the correct time to understand Jenkins architecture.
Let us revise the standalone Jenkins architecture that I have explained to you in the previous blog, below diagram depicts the same.
This single Jenkins server was not enough to meet certain requirements like:
To address the above stated needs, Jenkins distributed architecture was introduced.
Jenkins uses a Master-Slave architecture to manage distributed builds. In this architecture, Master and Slave communicate through TCP/IP protocol.
Jenkins Master
Your main Jenkins server is the Master. The Master’s job is to handle:
A Slave is a Java executable that runs on a remote machine. Following are the characteristics of Jenkins Slaves:
The diagram below is self explanatory. It consists of a Jenkins Master which is managing three Jenkins Slave.
Now let us look at an example in which Jenkins is used for testing in different environments like: Ubuntu, MAC, Windows etc.
The diagram below represents the same:
The following functions are performed in the above image:
It is used to know which task Jenkins is currently executing. Often several different changes are made by several developers at once, so it is useful to know which change is getting tested or which change is sitting in the queue or which build is broken. This is where pipeline comes into picture. The Jenkins Pipeline gives you an overview of where tests are up to. In build pipeline the build as a whole is broken down into sections, such as the unit test, acceptance test, packaging, reporting and deployment phases. The pipeline phases can be executed in series or parallel, and if one phase is successful, it automatically moves on to the next phase (hence the relevance of the name “pipeline”).The below image shows how a multiple build Pipeline looks like.
Hope you have understood the theoretical concepts. Now, let’s have some fun with hands-on.
I will create a new job in Jenkins, it is a Freestyle Project. However, there are 3 more options available. Let us look at the types of build jobs available in Jenkins.
Freestyle Project:
Freestyle build jobs are general-purpose build jobs, which provides maximum flexibility. The freestyle build job is the most flexible and configurable option, and can be used for any type of project. It is relatively straightforward to set up, and many of the options we configure here also appear in other build jobs.
The “multiconfiguration project” (also referred to as a “matrix project”) allows you run the same build job on different environments. It is used for testing an application in different environments, with different databases, or even on different build machines.
Monitor an External Job:
The “Monitor an external job” build job lets you keep an eye on non-interactive processes, such as cron jobs.
Maven Project:
The “maven2/3 project” is a build job specially adapted to Maven projects. Jenkins understands Maven pom files and project structures, and can use the information gleaned from the pom file to reduce the work you need to do to set up your project.
Here is a video on Jenkins tutorial for better understanding of Jenkins. Check out this Jenkins tutorial video.
Step 1: From the Jenkins interface home, select New Item.
Step 2: Enter a name and select Freestyle project.
Step 3: This next page is where you specify the job configuration. As you’ll quickly observe, there are a number of settings available when you create a new project. On this configuration page, you also have the option to Add build step to perform extra actions like running scripts. I will execute a shell script.
This will provide you with a text box in which you can add whatever commands you need. You can use scripts to run various tasks like server maintenance, version control, reading system settings, etc. I will use this section to run a simple script.
Step 4: Save the project, and you’ll be taken to a project overview page. Here you can see information about the project, including its built history.
Step 5: Click Build Now on the left-hand side to start the build.
Step 6: To see more information, click on that build in the build history area, whereupon you’ll be taken to a page with an overview of the build information.
Step 7: The Console Output link on this page is especially useful for examining the results of the job in detail.
Step 8: If you go back to Jenkins home, you’ll see an overview of all projects and their information, including status.
Status of the build is indicated in two ways, by a weather icon and by a colored ball. The weather icon is particularly helpful as it shows you a record of multiple builds in one image.
As you can see in the above image, the sun represents that all of my builds were successful. The color of the ball gives us the status of that particular build, in the above image the color of the ball is blue which means that this particular build was successful.
In this Jenkins Tutorial, I have just given an introductory example. In my next blog, I will show you how to pull and build code from the GitHub repository using Jenkins.
If you found this Jenkins Tutorial relevant, check out the DevOps training by Edureka, a trusted online learning company with a network of more than 250,000 satisfied learners spread across the globe. The Edureka DevOps Certification Training course helps learners gain expertise in various DevOps processes and tools such as Puppet, Jenkins, Nagios and GIT for automating multiple steps in SDLC.
Got a question for us? Please mention it in the comments section and we will get back to you.
Course Name | Date | |
---|---|---|
DevOps Certification Training Course | Class Starts on 28th May,2022 28th May SAT&SUN (Weekend Batch) | View Details |
DevOps Certification Training Course | Class Starts on 30th May,2022 30th May MON-FRI (Weekday Batch) | View Details |
DevOps Certification Training Course | Class Starts on 25th June,2022 25th June SAT&SUN (Weekend Batch) | View Details |
edureka.co
The best explanation I have ever came across. Easy to understand and learn all about Jenkins in one go.
Thanks
http://jenkinshelp.blogspot.in/
Hey buddy great Post,
I found something helpful which I want to share as I was browsing the web for learning some coding algorithms it was very difficult to visit different sites at a time but I found a site named https://hackr.io/
I went here and found that the stuff from best programming sites were all allocated at a single place so I just thought of sharing with you all.
I hope it will help you
This might be useful to your readers: https://hackr.io/tutorials/learn-jenkins
Hi,can you tell me if jenkins can be installed on windows?if so how?
Hey Priya, thanks for checking out our blog.
Yes it can be installed. Please follow the below steps :WINDOWS:
STEP 1:
Go to this link https://jenkins.io/download/
and download the war file
STEP 2:
put this war file in DESKTOP or anywhere
STEP 3:
start powershell or command prompt
cd to directory where u have kept the war file ( cd Desktop if u have saved on desktop)
STEP 4:
execute the command
java -jar jenkins.war
http://ip-of-your-machine:8080.(here we can see the jenkins dashboard)’
Hope this helps. Cheers!
Saurabh Can you please also explain some real time issues and commands which you use in Jenkins. that would be really helpfull
Very nice explanation. Helped me clear basic concepts of Jenkins.
Hey Sai Kumar, thanks for the wonderful feedback! We’re glad we could be of help.
Do subscribe to our blog to stay posted on upcoming blog posts. Cheers!
This tutorial is very helpful , so where i can get the next block of your , Thanks in Advance.
Hey Chandu, thanks for checking out the blog. I’m glad you liked it. I’ll be publishing the next blog in the series very soon. Please subscribe to our blog to stay posted. Cheers!