Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds

Exploring Jenkins

Save for later
  • 420 min read
  • 2015-08-10 00:00:00

article-image

In this article by Mitesh Soni, the author of the book Jenkins Essentials, introduces us to Jenkins.

(For more resources related to this topic, see here.)

Jenkins is an open source application written in Java. It is one of the most popular continuous integration (CI) tools used to build and test different kinds of projects. In this article, we will have a quick overview of Jenkins, essential features, and its impact on DevOps culture. Before we can start using Jenkins, we need to install it. In this article, we have provided a step-by-step guide to install Jenkins. Installing Jenkins is a very easy task and is different from the OS flavors.

This article will also cover the DevOps pipeline.

To be precise, we will discuss the following topics in this article:

  • Introduction to Jenkins and its features
  • Installation of Jenkins on Windows and the CentOS operating system
  • How to change configuration settings in Jenkins
  • What is the deployment pipeline

On your mark, get set, go!

Introduction to Jenkins and its features

Let's first understand what continuous integration is. CI is one of the most popular application development practices in recent times. Developers integrate bug fix, new feature development, or innovative functionality in code repository. The CI tool verifies the integration process with an automated build and automated test execution to detect issues with the current source of an application, and provide quick feedback.

exploring-jenkins-img-0

Jenkins is a simple, extensible, and user-friendly open source tool that provides CI services for application development. Jenkins supports SCM tools such as StarTeam, Subversion, CVS, Git, AccuRev and so on. Jenkins can build Freestyle, Apache Ant, and Apache Maven-based projects.

The concept of plugins makes Jenkins more attractive, easy to learn, and easy to use. There are various categories of plugins available such as Source code management, Slave launchers and controllers, Build triggers, Build tools, Build notifies, Build reports, other post-build actions, External site/tool integrations, UI plugins, Authentication and user management, Android development, iOS development, .NET development, Ruby development, Library plugins, and so on.

Jenkins defines interfaces or abstract classes that model a facet of a build system. Interfaces or abstract classes define an agreement on what needs to be implemented; Jenkins uses plugins to extend those implementations.

To learn more about all plugins, visit https://wiki.jenkins-ci.org/x/GIAL.

To learn how to create a new plugin, visit https://wiki.jenkins-ci.org/x/TYAL.

To download different versions of plugins, visit https://updates.jenkins-ci.org/download/plugins/.

Features

Jenkins is one of the most popular CI servers in the market. The reasons for its popularity are as follows:

  • Easy installation on different operating systems.
  • Easy upgrades—Jenkins has very speedy release cycles.
  • Simple and easy-to-use user interface.
  • Easily extensible with the use of third-party plugins—over 400 plugins.
  • Easy to configure the setup environment in the user interface. It is also possible to customize the user interface based on likings.
  • The master slave architecture supports distributed builds to reduce loads on the CI server.
  • Jenkins is available with test harness built around JUnit; test results are available in graphical and tabular forms.
  • Build scheduling based on the cron expression (to know more about cron, visit http://en.wikipedia.org/wiki/Cron).
  • Shell and Windows command execution in prebuild steps.
  • Notification support related to the build status.

Installation of Jenkins on Windows and CentOS

  1. Go to https://jenkins-ci.org/. Find the Download Jenkins section on the home page of Jenkins's website.

    exploring-jenkins-img-1

  2. Download the war file or native packages based on your operating system. A Java installation is needed to run Jenkins.
  3. Install Java based on your operating system and set the JAVA_HOME environment variable accordingly.

Installing Jenkins on Windows

  1. Select the native package available for Windows. It will download jenkins-1.xxx.zip. In our case, it will download jenkins-1.606.zip. Extract it and you will get setup.exe and jenkins-1.606.msi files.
  2. Click on setup.exe and perform the following steps in sequence. On the welcome screen, click Next:

    exploring-jenkins-img-2

  3. Select the destination folder and click on Next.
  4. Click on Install to begin installation. Please wait while the Setup Wizard installs Jenkins.

    exploring-jenkins-img-3

  5. Once the Jenkins installation is completed, click on the Finish button.

    exploring-jenkins-img-4

    Unlock access to the largest independent learning library in Tech for FREE!
    Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
    Renews at $19.99/month. Cancel anytime
  6. Verify the Jenkins installation on the Windows machine by opening URL http://<ip_address>:8080 on the system where you have installed Jenkins.

    exploring-jenkins-img-5

Installation of Jenkins on CentOS

  1. To install Jenkins on CentOS, download the Jenkins repository definition to your local system at /etc/yum.repos.d/ and import the key.
  2. Use the wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo command to download repo.

    exploring-jenkins-img-6

  3. Now, run yum install Jenkins; it will resolve dependencies and prompt for installation.

    exploring-jenkins-img-7

  4. Reply with y and it will download the required package to install Jenkins on CentOS. Verify the Jenkins status by issuing the service jenkins status command. Initially, it will be stopped. Start Jenkins by executing service jenkins start in the terminal.

    exploring-jenkins-img-8

  5. Verify the Jenkins installation on the CentOS machine by opening the URL http://<ip_address>:8080 on the system where you have installed Jenkins.

    exploring-jenkins-img-9

How to change configuration settings in Jenkins

  1. Click on the Manage Jenkins link on the dashboard to configure system, security, to manage plugins, slave nodes, credentials, and so on.

    exploring-jenkins-img-10

  2. Click on the Configure System link to configure Java, Ant, Maven, and other third-party products' related information.

    exploring-jenkins-img-11

  3. Jenkins uses Groovy as its scripting language. To execute the arbitrary script for administration/trouble-shooting/diagnostics on the Jenkins dashboard, go to the Manage Jenkins link on the dashboard, click on Script Console, and run println(Jenkins.instance.pluginManager.plugins).

    exploring-jenkins-img-12

  4. To verify the system log, go to the Manage Jenkins link on the dashboard and click on the System Log link or visit http://localhost:8080/log/all.

    exploring-jenkins-img-13

  5. To get more information on third-party libraries—version and license information in Jenkins, go to the Manage Jenkins link on the dashboard and click on the About Jenkins link.

    exploring-jenkins-img-14

What is the deployment pipeline?

The application development life cycle is a traditionally lengthy and a manual process. In addition, it requires effective collaboration between development and operations teams. The deployment pipeline is a demonstration of automation involved in the application development life cycle containing the automated build execution and test execution, notification to the stakeholder, and deployment in different runtime environments. Effectively, the deployment pipeline is a combination of CI and continuous delivery, and hence is a part of DevOps practices. The following diagram depicts the deployment pipeline process:

exploring-jenkins-img-15

Members of the development team check code into a source code repository. CI products such as Jenkins are configured to poll changes from the code repository. Changes in the repository are downloaded to the local workspace and Jenkins triggers an automated build process, which is assisted by Ant or Maven. Automated test execution or unit testing, static code analysis, reporting, and notification of successful or failed build process are also part of the CI process.

Once the build is successful, it can be deployed to different runtime environments such as testing, preproduction, production, and so on. Deploying a war file in terms of the JEE application is normally the final stage in the deployment pipeline.

One of the biggest benefits of the deployment pipeline is the faster feedback cycle. Identification of issues in the application at early stages and no dependencies on manual efforts make this entire end-to-end process more effective.

To read more, visit http://martinfowler.com/bliki/DeploymentPipeline.html and http://www.informit.com/articles/article.aspx?p=1621865&seqNum=2.

Summary

Congratulations! We reached the end of this article and hence we have Jenkins installed on our physical or virtual machine. Till now, we covered the basics of CI and the introduction to Jenkins and its features. We completed the installation of Jenkins on Windows and CentOS platforms. In addition to this, we discussed the deployment pipeline and its importance in CI.

Resources for Article:


Further resources on this subject:


Modal Close icon
Modal Close icon