O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Jenkins Essentials - Second Edition

Book Description

Develop a base for DevOps culture by implementing Continuous Integration and Continuous Delivery including automated builds, unit test execution, packaging, and static code analysis with Jenkins 2

About This Book

  • Explore Continuous Integration and automation, along with how to manage and configure Jenkins
  • Master using Jenkins to build, test, and package Java applications
  • Learn about Jenkins' extensible features with automated deployment on cloud platforms such as AWS Elastic Beanstalk and Microsoft Azure App Services
  • Learn about creating a pipeline using Build Pipeline plugin and the Pipeline as Code feature available after the release of Jenkins 2.0

Who This Book Is For

If you are a Jenkins novice or beginner with a basic or no understanding of Continuous Integration, then this is the book for you. Beginners in Jenkins will get quick hands-on experience and gain the confidence to explore the use of Jenkins further.

What You Will Learn

  • Get to grips with the challenges faced by developer communities
  • Learn about Continuous Integration and how it helps build various Java applications
  • Facilitate the installation and configuration of Jenkins
  • Install and configure code repositories and build tools
  • Learn about the integration of Eclipse with Jenkins
  • Manage the integration of Jenkins, code repositories, and build tools
  • Familiarize yourself with Continuous Integration for Java applications with unit test execution and static code analysis
  • Learn about Continuous Delivery and how to deploy applications in AWS and Microsoft Azure

In Detail

In agile development practices, developers need to integrate their work frequently to fix bugs or to create a new feature or functionality. Jenkins is used specifically for Continuous Integration, helping to enforce the principles of agile development. This book focuses on the latest and stable release of Jenkins (2.5 and later), featuring the latest features, such as Pipeline as Code, the new setup experience, and the improved UI. With the all-new Pipeline as Code feature, you will be able to build simple or advanced pipelines easily and rapidly, hence improving your teams' productivity.

This book begins by tackling the installation of the necessary software dependencies and libraries you'll need to perform Continuous Integration for a Java application. From there, you'll integrate code repositories, applications, and build tools for the implementation of Continuous Integration.

Finally, you will also learn how to automate your deployment on cloud platforms such as AWS and Microsoft Azure, along with a few advanced testing techniques.

Style and approach

This book provides simple, step-by-step instructions, taking you from start to finish in accomplishing real-world Continuous Integration and Continuous Delivery tasks.

Table of Contents

  1. Preface
    1. What this book covers
    2. What you need for this book
    3. Who this book is for
    4. Conventions
    5. Reader feedback
    6. Customer support
      1. Downloading the example code
      2. Downloading the color images of this book
      3. Errata
      4. Piracy
      5. Questions
  2. Exploring Jenkins
    1. Introduction of Jenkins 2
      1. Features
    2. Installation of Jenkins 2
    3. Jumpstart tour of the Jenkins dashboard
    4. Configuration settings in Jenkins
    5. Overview of the CI/CD pipeline
    6. Summary
  3. Installation and Configuration of Code Repository and Build Tools
    1. Overview of Jenkins
    2. Installing Java and configuring the environment variables
      1. Installing Java on Windows 10
      2. Installing Java on CentOS
        1. Configuring environment variables
    3. Installing and configuring Ant
      1. Configuring Ant in Windows
      2. Configuring Ant in CentOS
    4. Installing Maven
    5. Configuring Ant, Maven, and JDK in Jenkins
    6. First job in Jenkins
    7. Installing and configuring the Git repository on CentOS
      1. Creating a new build job in Jenkins with Git and GitHub
    8. Eclipse and Jenkins integration
    9. Summary
  4. Managing Code Quality and Notifications
    1. Jenkins 2.x integration with Sonar 6.3
    2. Quality Gate plugin
    3. Email notifications on build status
    4. Summary
  5. Continuous Integration with Jenkins
    1. Dashboard View plugin
    2. Creating and configuring a build job for a Java application with Ant
    3. Creating and configuring a build job for a Java application with Maven
    4. Summary
  6. Continuous Delivery - Implementing Automated Deployment
    1. An overview of Continuous Delivery and Continuous Deployment
    2. Installing Tomcat
    3. Deploying a war file from Jenkins to Tomcat
    4. Deploying a WAR file from Jenkins to AWS Elastic Beanstalk
    5. Deploying a war file from Jenkins to Microsoft Azure App Services
    6. Summary
  7. Continuous Testing - Functional and Load Testing with Jenkins
    1. Functional testing with Selenium
    2. Load testing with Apache JMeter
    3. Summary
  8. Build Pipeline and Pipeline as a Code
    1. Build Pipeline
      1. Upstream and downstream jobs
    2. Overview of pipeline as a code
      1. Pipeline as a code - implementation
    3. Promoted builds
    4. Summary
  9. Managing and Monitoring Jenkins
    1. Managing Jenkins master and slave nodes
    2. Monitoring Jenkins with JavaMelody
    3. Managing job-specific configurations - backup and restore
    4. Managing disk usage
    5. Build job-specific monitoring with the Build Monitor plugin
    6. Audit Trail plugin-overview and usage
    7. Workspace Cleanup plugin
    8. Conditional Build Step plugin
    9. EnvInject plugin
    10. Summary
  10. Security in Jenkins
    1. User management
    2. Role-based security
    3. Project-based security
    4. Summary