Book Image

Learning Continuous Integration with Jenkins

By : Nikhil Pathania
Book Image

Learning Continuous Integration with Jenkins

By: Nikhil Pathania

Overview of this book

In past few years, Agile software development has seen tremendous growth across the world. There is huge demand for software delivery solutions that are fast yet flexible to frequent amendments. As a result, CI and continuous delivery methodologies are gaining popularity. Jenkins’ core functionality and flexibility allows it to fit in a variety of environments and can help streamline the development process for all stakeholders. This book starts off by explaining the concepts of CI and its significance in the Agile world with a whole chapter dedicated to it. Next, you’ll learn to configure and set up Jenkins. You’ll gain a foothold in implementing CI and continuous delivery methods. We dive into the various features offered by Jenkins one by one exploiting them for CI. After that, you’ll find out how to use the built-in pipeline feature of Jenkins. You’ll see how to integrate Jenkins with code analysis tools and test automation tools in order to achieve continuous delivery. Next, you’ll be introduced to continuous deployment and learn to achieve it using Jenkins. Through this book’s wealth of best practices and real-world tips, you'll discover how easy it is to implement a CI service with Jenkins.
Table of Contents (15 chapters)
Learning Continuous Integration with Jenkins
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Preface

In the past few years, the agile model of software development has seen a considerable amount of growth around the world. There is a huge demand for a software delivery solution that is fast and flexible to frequent amendments, a specially in the e-commerce sector. As a result, Continuous Integration and Continuous Delivery methodologies are gaining popularity.

Whether small or big, all types of project are gaining benefits, such as early issue detection, avoiding bad code into production, and faster delivery, which lead to an increase in productivity.

This book, Learning Continuous Integration with Jenkins, serves as a step-by-step guide to setting up Continuous Integration, Continuous Delivery, and Continuous Deployment systems using hands-on examples. The book is 20% theory and 80% practical. The book starts by explaining the concepts of Continuous Integration and its significance in the agile world with a complete chapter dedicated to it. Users then learn how to configure and set up Jenkins. The first three chapters prepare the readers for the next important chapters that deal with setting up of Continuous Integration, Continuous Delivery, and Continuous Deployment.

What this book covers

Chapter 1, Concepts of Continuous Integration, has an account of how some of the most popular and widely used software development methodologies gave rise to Continuous Integration. It is followed by an in-depth explanation of the various requirements and best practices of Continuous Integration.

Chapter 2, Setting up Jenkins, is a step-by-step guide that is all about installing Jenkins across various platforms and particularly on the Apache Tomcat server.

Chapter 3, Configuring Jenkins, is an overview of how Jenkins looks and feels with an in-depth explanation of its important constituents. It is followed by a step-by-step guide to accomplishing some of the basic Jenkins administration tasks.

Chapter 4, Continuous Integration Using Jenkins – Part I, is a step-by-step guide that takes you through a Continuous Integration Design and the means to achieve it using Jenkins, in collaboration with some other DevOps tools.

Chapter 5, Continuous Integration Using Jenkins – Part II, is a continuation of the previous chapter.

Chapter 6, Continuous Delivery Using Jenkins, is a step-by-step guide that takes you through a Continuous Delivery Design and the means to achieve it using Jenkins, in collaboration with some other DevOps tools.

Chapter 7, Continuous Deployment Using Jenkins, explains the difference between Continuous Delivery and Continuous Deployment. It is followed by a step-by-step guide that takes you through a Continuous Deployment Design and the means to achieve it using Jenkins, in collaboration with some other DevOps tools.

Chapter 8, Jenkins Best Practices, is a step-by-step guide to accomplishing distributed builds using the Jenkins master-slave architecture. It is followed by some practical examples that depict some of the Jenkins best practices.

What you need for this book

To set up the Jenkins server, you will need a machine with the following configurations.

Operating systems:

  • Windows 7/8/9/10

  • Ubuntu 14 and above

Software tools (minimum version):

  • 7Zip 15.09 beta

  • Apache JMeter 2.13

  • Apache Tomcat server 8.0.26

  • Artifactory 4.3.2 (maximum version for the build breaker plugin to work)

  • Atlassian SourceTree 1.6.25

  • Git 2.6.3

  • Java JDK 1.8.0

  • Java JRE 1.8.0

  • Jenkins 1.635

  • Maven 3.3.9

  • Selenium for Eclipse 2.51

  • SonarQube 5.1.2

  • TestNG for Eclipse 6.8

  • Eclipse Mars.1

Hardware requirements:

  • A machine with a minimum 1 GB of memory and a multi-core processor

Who this book is for

This book is aimed at readers with little or no previous experience with agile or Continuous Integration. It serves as a great starting point for everyone who is new to the field of DevOps and would like to leverage the benefits of Continuous Integration and Continuous Delivery in order to increase productivity and reduce delivery time.

Build and release engineers, deployment engineers, DevOps engineers, SCM (Software Configuration Management) engineers, developers, testers, and project managers all can benefit from this book.

The readers who are already using Jenkins for Continuous Integration can learn to take their project to the next level, which is Continuous Delivery. This book discusses Continuous Integration, Continuous Delivery, and Continuous Deployment using a Java-based project. Nevertheless, the concepts are still applicable if you are using other technology setups, such as Ruby on Rails or .NET. In addition to that, the Jenkins concepts, installation, best practices, and administration, remain the same irrespective of the technology stack you use.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input and Twitter handles are shown as follows: "You have make and omake, and also clearmake if you are using IBM Rational ClearCase as the version control tool."

A block of code is set as follows:

# Print a message.
  print "Hello, World!\n";
  print "Good Morning!\n";

Any command-line input or output is written as follows:

cd /etc/sysconfig/
vi jenkins

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Click on the Install as Windows Service link."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.

  2. Hover the mouse pointer on the SUPPORT tab at the top.

  3. Click on Code Downloads & Errata.

  4. Enter the name of the book in the Search box.

  5. Select the book for which you're looking to download the code files.

  6. Choose from the drop-down menu where you purchased this book from.

  7. Click on Code Download.

You can also download the code files by clicking on the Code Files button on the book's webpage at the Packt Publishing website. This page can be accessed by entering the book's name in the Search box. Please note that you need to be logged in to your Packt account.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows

  • Zipeg / iZip / UnRarX for Mac

  • 7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Learning-Continuous-Integration-with-Jenkins. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.