A Guide to Start with Jenkins
Author XYZ is a passionate software wizard and well-known professional of Jenkins. He has a lot of experience of working with many companies and also run online courses related to Jenkins. He has several best- selling courses at Udemy and has many students around the world.
Table of Contents
Brief Introduction and History of Jenkins
Jenkins (written in Java) is a continuous integration server. It can handle any type of build or continuous integration. It is used by different teams of different sizes for those projects that may have heterogeneous languages (Java, .net, php etc.)
Jenkins is very popular because of the following reasons:
- Easy to use
Jenkins has a relatively low learning curve. It is flexible and easy to adapt.
- Great Extensibility
It provides a wide range of plugins that help to support different version control systems, code quality metrics and provide UI customization.
Hudson was started in 2004 by Kohsuke Kawaguchi at Sun Micro Systems. It was started as a hobby project. Hudson was first officially released in 2005. As more and more teams adapted Hudson for their own projects at Sun Micro Systems so Kohsuke worked on Hudson full time in 2008 after seeing its popularity. Because of professional services and support, Hudson became the leading CI solution with a market share of over 70% in 2010. In Jan 2011, Hudson was renamed as Jenkins.
What is CI or Continuous Integration?
A continuous integration is the practice of running tests on non-developer machine automatically every time when new code is pushed into source repository. It helps to remove problem of finding later occurrence of issues. CI demands frequent build from developers. Build should be triggered whenever a code commits occur.
Jenkins Architecture and important Jenkins terms
Jenkins follows a master and slave architecture to manage distributed jobs. Master not only schedules build jobs but also dispatches build to the slaves for actual job execution. Slave is a small Java program that listens to the requests from Jenkins master and executes build jobs. Following figure show the architecture diagram:
Important Jenkins terminologies
- Job/ Project: Both refer to runnable tasks that are monitored by Jenkins
- Slave: A computer that builds projects for master
- Node: Node includes all the machines that are part of Jenkins grid
- Executor: A node may have many executors. It is a separate stream of builds to be run on a node parallel
- Build: Result of one of the projects
- Plugin: A piece of software that extends core functionality of core Jenkins server.
Installation of Java
Jenkins requires minimum Java 7 to be installed. It is also recommended to install Java 8. First, check if Java is installed on your laptop. You can install Java on your local laptop by writing following command.
If Java is already installed then above command will tell which version of Java you are currently using.
If you don’t have Java installed or your version of Java is older than 7, lets install Java first. (Note: If Java is already installed then ignore these steps)
Go to Google and write ‘Install Java se’. The third web link is the official site to download Oracle Java Development Kit. Just click the link.
On the official website of Java, click on ‘Accept License Agreement’.
Now choose the matching platform that you are using on your local laptop. Once installer has downloaded, just run the installer and accept all defaults. Now the download is complete.