Book Image

Jenkins 2.x Continuous Integration Cookbook - Third Edition

By : Mitesh Soni, Alan Mark Berg
Book Image

Jenkins 2.x Continuous Integration Cookbook - Third Edition

By: Mitesh Soni, Alan Mark Berg

Overview of this book

Jenkins 2.x is one of the most popular Continuous Integration servers in the market today. It was designed to maintain, secure, communicate, test, build, and improve the software development process. This book will begin by guiding you through steps for installing and configuring Jenkins 2.x on AWS and Azure. This is followed by steps that enable you to manage and monitor Jenkins 2.x. You will also explore the ways to enhance the overall security of Jenkins 2.x. You will then explore the steps involved in improving the code quality using SonarQube. Then, you will learn the ways to improve quality, followed by how to run performance and functional tests against a web application and web services. Finally, you will see what the available plugins are, concluding with best practices to improve quality.
Table of Contents (11 chapters)

Installing Jenkins 2 on CentOS

Let's look at the steps required to install Jenkins on CentOS.

Getting ready

For a business unit, it is advisable to have the following requirements:

  • Java 8
  • 4 GB+ RAM
  • 500 GB+ free disk space

Jenkins requires Java. To install Java, execute:

sudo yum install java

How to do it...

  1. Jenkins' stable and recent versions are available in a YUM repository.
  2. Add the Jenkins repository to the yum repos:
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo  
  1. For the stable version, execute:
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo  
  1. Import the following key:
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key  
  1. Install Jenkins by executing the following command:
sudo yum install jenkins  

There's more...

  • To start the Jenkins service, execute:
sudo service jenkins start  
  • To stop the Jenkins service, execute:
sudo service jenkins stop  
  • To restart the Jenkins service, execute:
sudo service jenkins restart