Jenkins: The Definitive Guide
Free

Jenkins: The Definitive Guide

By John Ferguson Smart
Free
Book Description

Continuous Integration, or CI, is a cornerstone of modern software development best practices. Jenkins, an Open Source Continuous Integration tool, is by far the most popular Continuous Integration tool on the market, and for good reason! It's intuitive user interface and powerful features make setting up a Continuous Integration service a real breeze.



This book will teach you how to build a powerful and robust CI infrastructure using Jenkins. It is both a tutorial-style introduction and a comprehensive reference to implementing Continuous Integration and automating the build process with Jenkins. It's intention is not only to describe and document Jenkins, but also to provide a wealth of best practices and real-world tips enabling readers to get the most out of their Continuous Integration environment.



Jenkins: The Definitive Guide is an open source book, and is freely available online and in PDF form. The printed copy and eBook versions (ePub, mobi) are also available for purchase here.

Table of Contents
  • Jenkins: The Definitive Guide
  • Table of Contents
  • Copyright
  • Foreword
  • Preface
    • 1. Audience
    • 2. Book Layout
    • 3. Jenkins or Hudson?
    • 4. Font Conventions
    • 5. Command-Line Conventions
    • 6. Contributors
    • 7. The Review Team
    • 8. Book Sponsors
      • 8.1. Wakaleo Consulting
      • 8.2. CloudBees
      • 8.3. Odd-e
    • 9. Using Code Examples
    • 10. Safari® Books Online
    • 11. How to Contact Us
    • 12. Acknowledgments
  • Chapter 1. Introducing Jenkins
    • 1.1. Introduction
    • 1.2. Continuous Integration Fundamentals
    • 1.3. Introducing Jenkins (née Hudson)
    • 1.4. From Hudson to Jenkins—A Short History
    • 1.5. Should I Use Jenkins or Hudson?
    • 1.6. Introducing Continuous Integration into Your Organization
      • 1.6.1. Phase 1—No Build Server
      • 1.6.2. Phase 2—Nightly Builds
      • 1.6.3. Phase 3—Nightly Builds and Basic Automated Tests
      • 1.6.4. Phase 4—Enter the Metrics
      • 1.6.5. Phase 5—Getting More Serious About Testing
      • 1.6.6. Phase 6—Automated Acceptance Tests and More Automated Deployment
      • 1.6.7. Phase 7—Continuous Deployment
    • 1.7. Where to Now?
  • Chapter 2. Your First Steps with Jenkins
    • 2.1. Introduction
    • 2.2. Preparing Your Environment
      • 2.2.1. Installing Java
      • 2.2.2. Installing Git
      • 2.2.3. Setting Up a GitHub Account
      • 2.2.4. Configuring SSH Keys
      • 2.2.5. Forking the Sample Repository
    • 2.3. Starting Up Jenkins
    • 2.4. Configuring the Tools
      • 2.4.1. Configuring Your Maven Setup
      • 2.4.2. Configuring the JDK
      • 2.4.3. Notification
      • 2.4.4. Setting Up Git
    • 2.5. Your First Jenkins Build Job
    • 2.6. Your First Build Job in Action
    • 2.7. More Reporting—Displaying Javadocs
    • 2.8. Adding Code Coverage and Other Metrics
    • 2.9. Conclusion
  • Chapter 3. Installing Jenkins
    • 3.1. Introduction
    • 3.2. Downloading and Installing Jenkins
    • 3.3. Preparing a Build Server for Jenkins
    • 3.4. The Jenkins Home Directory
    • 3.5. Installing Jenkins on Debian or Ubuntu
    • 3.6. Installing Jenkins on Redhat, Fedora, or CentOS
    • 3.7. Installing Jenkins on SUSE or OpenSUSE
    • 3.8. Running Jenkins as a Stand-Alone Application
    • 3.9. Running Jenkins Behind an Apache Server
    • 3.10. Running Jenkins on an Application Server
    • 3.11. Memory Considerations
    • 3.12. Installing Jenkins as a Windows Service
    • 3.13. What’s in the Jenkins Home Directory
    • 3.14. Backing Up Your Jenkins Data
    • 3.15. Upgrading Your Jenkins Installation
    • 3.16. Conclusion
  • Chapter 4. Configuring Your Jenkins Server
    • 4.1. Introduction
    • 4.2. The Configuration Dashboard—The Manage Jenkins Screen
    • 4.3. Configuring the System Environment
    • 4.4. Configuring Global Properties
    • 4.5. Configuring Your JDKs
    • 4.6. Configuring Your Build Tools
      • 4.6.1. Maven
      • 4.6.2. Ant
      • 4.6.3. Shell-Scripting Language
    • 4.7. Configuring Your Version Control Tools
      • 4.7.1. Configuring Subversion
      • 4.7.2. Configuring CVS
    • 4.8. Configuring the Mail Server
    • 4.9. Configuring a Proxy
    • 4.10. Conclusion
  • Chapter 5. Setting Up Your Build Jobs
    • 5.1. Introduction
    • 5.2. Jenkins Build Jobs
    • 5.3. Creating a Freestyle Build Job
      • 5.3.1. General Options
      • 5.3.2. Advanced Project Options
    • 5.4. Configuring Source Code Management
      • 5.4.1. Working with Subversion
      • 5.4.2. Working with Git
        • 5.4.2.1. Installing the plugin
          • 5.4.2.1.1. System-wide configuration of the plugin
          • 5.4.2.1.2. SSH key setup
        • 5.4.2.2. Using the plugin
          • 5.4.2.2.1. Advanced per-project source code management configuration
          • 5.4.2.2.2. Branches to build
          • 5.4.2.2.3. Excluded regions
          • 5.4.2.2.4. Excluded users
          • 5.4.2.2.5. Checkout/merge to local branch
          • 5.4.2.2.6. Local subdirectory for repo
          • 5.4.2.2.7. Merge before build
          • 5.4.2.2.8. Prune remote branches before build
          • 5.4.2.2.9. Clean after checkout
          • 5.4.2.2.10. Recursively update submodules
          • 5.4.2.2.11. Use commit author in changelog
          • 5.4.2.2.12. Wipe out workspace
          • 5.4.2.2.13. Choosing strategy
          • 5.4.2.2.14. Git executable
          • 5.4.2.2.15. Repository browser
        • 5.4.2.3. Build triggers
          • 5.4.2.3.1. Gerrit Trigger
        • 5.4.2.4. Post-build actions
          • 5.4.2.4.1. Push only if build succeeds
          • 5.4.2.4.2. Merge results
          • 5.4.2.4.3. Tags
          • 5.4.2.4.4. Branches
        • 5.4.2.5. GitHub plugin
    • 5.5. Build Triggers
      • 5.5.1. Triggering a Build Job Once Another Build Job Has Finished
      • 5.5.2. Scheduled Build Jobs
      • 5.5.3. Polling the SCM
      • 5.5.4. Triggering Builds Remotely
      • 5.5.5. Manual Build Jobs
    • 5.6. Build Steps
      • 5.6.1. Maven Build Steps
      • 5.6.2. Ant Build Steps
      • 5.6.3. Executing a Shell or Windows Batch Command
      • 5.6.4. Using Jenkins Environment Variables in Your Builds
      • 5.6.5. Running Groovy Scripts
      • 5.6.6. Building Projects in Other Languages
    • 5.7. Post-Build Actions
      • 5.7.1. Reporting on Test Results
      • 5.7.2. Archiving Build Results
      • 5.7.3. Notifications
      • 5.7.4. Building Other Projects
    • 5.8. Running Your New Build Job
    • 5.9. Working with Maven Build Jobs
      • 5.9.1. Building Whenever a SNAPSHOT Dependency Is Built
      • 5.9.2. Configuring the Maven Build
      • 5.9.3. Post-Build Actions
      • 5.9.4. Deploying to an Enterprise Repository Manager
      • 5.9.5. Deploying to Commercial Enterprise Repository Managers
      • 5.9.6. Managing Modules
      • 5.9.7. Extra Build Steps in Your Maven Build Jobs
    • 5.10. Using Jenkins with Other Languages
      • 5.10.1. Building Projects with Grails
      • 5.10.2. Building Projects with Gradle
        • 5.10.2.1. The Gradle plugin for Jenkins
        • 5.10.2.2. Incremental builds
      • 5.10.3. Building Projects with Visual Studio MSBuild
      • 5.10.4. Building Projects with NAnt
      • 5.10.5. Building Projects with Ruby and Ruby on Rails
    • 5.11. Conclusion
  • Chapter 6. Automated Testing
    • 6.1. Introduction
    • 6.2. Automating Your Unit and Integration Tests
    • 6.3. Configuring Test Reports in Jenkins
    • 6.4. Displaying Test Results
    • 6.5. Ignoring Tests
    • 6.6. Code Coverage
      • 6.6.1. Measuring Code Coverage with Cobertura
        • 6.6.1.1. Integrating Cobertura with Maven
        • 6.6.1.2. Integrating Cobertura with Ant
        • 6.6.1.3. Installing the Cobertura code coverage plugin
        • 6.6.1.4. Reporting on code coverage in your build
        • 6.6.1.5. Interpreting code coverage metrics
      • 6.6.2. Measuring Code Coverage with Clover
    • 6.7. Automated Acceptance Tests
    • 6.8. Automated Performance Tests with JMeter
    • 6.9. Help! My Tests Are Too Slow!
      • 6.9.1. Add More Hardware
      • 6.9.2. Run Fewer Integration/Functional Tests
      • 6.9.3. Run Your Tests in Parallel
    • 6.10. Conclusion
  • Chapter 7. Securing Jenkins
    • 7.1. Introduction
    • 7.2. Activating Security in Jenkins
    • 7.3. Simple Security in Jenkins
    • 7.4. Security Realms—Identifying Jenkins Users
      • 7.4.1. Using Jenkins’s Built-in User Database
      • 7.4.2. Using an LDAP Repository
      • 7.4.3. Using Microsoft Active Directory
      • 7.4.4. Using Unix Users and Groups
      • 7.4.5. Delegating to the Servlet Container
      • 7.4.6. Using Atlassian Crowd
      • 7.4.7. Integrating with Other Systems
    • 7.5. Authorization—Who Can Do What
      • 7.5.1. Matrix-based Security
        • 7.5.1.1. Setting up matrix-based security
        • 7.5.1.2. Fine-tuning user permissions
        • 7.5.1.3. Help! I’ve locked myself out!
      • 7.5.2. Project-based Security
      • 7.5.3. Role-based Security
    • 7.6. Auditing—Keeping Track of User Actions
    • 7.7. Conclusion
  • Chapter 8. Notification
    • 8.1. Introduction
    • 8.2. Email Notification
    • 8.3. More Advanced Email Notification
    • 8.4. Claiming Builds
    • 8.5. RSS Feeds
    • 8.6. Build Radiators
    • 8.7. Instant Messaging
      • 8.7.1. IM Notification with Jabber
      • 8.7.2. IM Notification using IRC
    • 8.8. IRC Notification
    • 8.9. Desktop Notifiers
    • 8.10. Notification via Notifo
    • 8.11. Mobile Notification
    • 8.12. SMS Notification
    • 8.13. Making Noise
    • 8.14. Extreme Feedback Devices
    • 8.15. Conclusion
  • Chapter 9. Code Quality
    • 9.1. Introduction
    • 9.2. Code Quality in Your Build Process
    • 9.3. Popular Java and Groovy Code Quality Analysis Tools
      • 9.3.1. Checkstyle
      • 9.3.2. PMD/CPD
      • 9.3.3. FindBugs
      • 9.3.4. CodeNarc
    • 9.4. Reporting on Code Quality Issues with the Violations Plugin
      • 9.4.1. Working with Freestyle Build Jobs
      • 9.4.2. Working with Maven Build Jobs
    • 9.5. Using the Checkstyle, PMD, and FindBugs Reports
    • 9.6. Reporting on Code Complexity
    • 9.7. Reporting on Open Tasks
    • 9.8. Integrating with Sonar
    • 9.9. Conclusion
  • Chapter 10. Advanced Builds
    • 10.1. Introduction
    • 10.2. Parameterized Build Jobs
      • 10.2.1. Creating a Parameterized Build Job
      • 10.2.2. Adapting Your Builds to Work with Parameterized Build Scripts
      • 10.2.3. More Advanced Parameter Types
      • 10.2.4. Building from a Subversion Tag
      • 10.2.5. Building from a Git Tag
      • 10.2.6. Starting a Parameterized Build Job Remotely
      • 10.2.7. Parameterized Build Job History
    • 10.3. Parameterized Triggers
    • 10.4. Multiconfiguration Build Jobs
      • 10.4.1. Setting Up a Multiconfiguration Build
      • 10.4.2. Configuring a Slave Axis
      • 10.4.3. Configuring a JDK Axis
      • 10.4.4. Custom Axis
      • 10.4.5. Running a Multiconfiguration Build
    • 10.5. Generating Your Maven Build Jobs Automatically
      • 10.5.1. Configuring a Job
      • 10.5.2. Reusing Job Configuration with Inheritance
      • 10.5.3. Plugin Support
      • 10.5.4. Freestyle Jobs
    • 10.6. Coordinating Your Builds
      • 10.6.1. Parallel Builds in Jenkins
      • 10.6.2. Dependency Graphs
      • 10.6.3. Joins
      • 10.6.4. Locks and Latches
    • 10.7. Build Pipelines and Promotions
      • 10.7.1. Managing Maven Releases with the M2Release Plugin
      • 10.7.2. Copying Artifacts
      • 10.7.3. Build Promotions
      • 10.7.4. Aggregating Test Results
      • 10.7.5. Build Pipelines
    • 10.8. Conclusion
  • Chapter 11. Distributed Builds
    • 11.1. Introduction
    • 11.2. The Jenkins Distributed Build Architecture
    • 11.3. Master/Slave Strategies in Jenkins
      • 11.3.1. The Master Starts the Slave Agent Using SSH
      • 11.3.2. Starting the Slave Agent Manually Using Java Web Start
      • 11.3.3. Installing a Jenkins Slave as a Windows Service
      • 11.3.4. Starting the Slave Node in Headless Mode
      • 11.3.5. Starting a Windows Slave as a Remote Service
    • 11.4. Associating a Build Job with a Slave or Group of Slaves
    • 11.5. Node Monitoring
    • 11.6. Cloud Computing
      • 11.6.1. Using Amazon EC2
        • 11.6.1.1. Setting up your Amazon EC2 build farm
        • 11.6.1.2. Using EC2 instances as part of your build farm
        • 11.6.1.3. Using dynamic instances
    • 11.7. Using the CloudBees DEV@cloud Service
    • 11.8. Conclusion
  • Chapter 12. Automated Deployment and Continuous Delivery
    • 12.1. Introduction
    • 12.2. Implementing Automated and Continuous Deployment
      • 12.2.1. The Deployment Script
      • 12.2.2. Database Updates
      • 12.2.3. Smoke Tests
      • 12.2.4. Rolling Back Changes
    • 12.3. Deploying to an Application Server
      • 12.3.1. Deploying a Java Application
        • 12.3.1.1. Using the Deploy plugin
        • 12.3.1.2. Redeploying a specific version
        • 12.3.1.3. Deploying a version from a previous Jenkins build
        • 12.3.1.4. Deploying a version from a Maven repository
      • 12.3.2. Deploying Scripting-based Applications Like Ruby and PHP
    • 12.4. Conclusion
  • Chapter 13. Maintaining Jenkins
    • 13.1. Introduction
    • 13.2. Monitoring Disk Space
      • 13.2.1. Using the Disk Usage Plugin
      • 13.2.2. Disk Usage and the Jenkins Maven Project Type
    • 13.3. Monitoring the Server Load
    • 13.4. Backing Up Your Configuration
      • 13.4.1. Fundamentals of Jenkins Backups
      • 13.4.2. Using the Backup Plugin
      • 13.4.3. More Lightweight Automated Backups
    • 13.5. Archiving Build Jobs
    • 13.6. Migrating Build Jobs
    • 13.7. Conclusion
  • Appendix A. Automating Your Unit and Integration Tests
    • A.1. Automating Your Tests with Maven
    • A.2. Automating Your Tests with Ant
  • Index
    No review for this book yet, be the first to review.
      No comment for this book yet, be the first to comment
      Also Available On
      App store smallGoogle play small
      Categories
      Curated Lists
      • Pattern Recognition and Machine Learning (Information Science and Statistics)
        by Christopher M. Bishop
        Data mining
        by I. H. Witten
        The Elements of Statistical Learning: Data Mining, Inference, and Prediction
        by Various
        See more...
      • CK-12 Chemistry
        by Various
        Concept Development Studies in Chemistry
        by John Hutchinson
        An Introduction to Chemistry - Atoms First
        by Mark Bishop
        See more...
      • Microsoft Word - How to Use Advanced Algebra II.doc
        by Jonathan Emmons
        Advanced Algebra II: Activities and Homework
        by Kenny Felder
        de2de
        by
        See more...
      • The Sun Who Lost His Way
        by
        Tania is a Detective
        by Kanika G
        Firenze_s-Light
        by
        See more...
      • Java 3D Programming
        by Daniel Selman
        The Java EE 6 Tutorial
        by Oracle Corporation
        JavaKid811
        by
        See more...