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 2.x Continuous Integration Cookbook - Third Edition

Book Description

Get a problem-solution approach enriched with code examples for practical and easy comprehension

About This Book

  • Explore the use of more than 40 best-of-breed plug-ins for improving efficiency
  • Secure and maintain Jenkins 2.x by integrating it with LDAP and CAS, which is a Single Sign-on solution
  • Efficiently build advanced pipelines with pipeline as code, thus increasing your team's productivity

Who This Book Is For

If you are a Java developer, a software architect, a technical project manager, a build manager, or a development or QA engineer, then this book is ideal for you. A basic understanding of the software development life cycle and Java development is needed, as well as a rudimentary understanding of Jenkins.

What You Will Learn

  • Install and Configure Jenkins 2.x on AWS and Azure
  • Explore effective ways to manage and monitor Jenkins 2.x
  • Secure Jenkins 2.x using Matrix-based Security
  • Deploying a WAR file from Jenkins 2.x to Azure App Services and AWS Beanstalk
  • Automate deployment of application on AWS and Azure PaaS
  • Continuous Testing – Unit Test Execution, Functional Testing and Load Testing

In Detail

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.

Style and approach

This book provides a problem-solution approach to some common tasks and some uncommon tasks using Jenkins 2.x and is well-illustrated with practical code examples.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased 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 code file.

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. Getting Started with Jenkins
    1. Introduction
    2. Installing Jenkins 2 on Windows
      1. Getting ready
      2. How to do it...
    3. Installing Jenkins 2 on CentOS
      1. Getting ready
      2. How to do it...
      3. There's more...
    4. Installing Jenkins 2 on Azure
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Installing Jenkins as a Service in Windows
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Installing plugins in Jenkins
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    7. Uploading plugins in Jenkins
      1. Getting ready
      2. How to do it...
      3. How it works...
    8. Configuring proxy in Jenkins
      1. Getting ready
      2. How to do it...
    9. Configuring global settings in Jenkins
      1. Getting ready
      2. How to do it...
      3. There's more...
    10. Configuring JENKINS_HOME
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    11. Understanding JENKINS_HOME directory
      1. Getting ready
      2. How to do it...
      3. See also
    12. Using different ports for Jenkins
      1. Getting ready
      2. How to do it...
      3. How it works...
    13. Configuring JAVA_HOME in Jenkins
      1. Getting ready
      2. How to do it...
      3. How it works...
    14. Configuring Git in Jenkins
      1. Getting ready
      2. How to do it...
      3. How it works...
    15. Configuring ANT_HOME in Jenkins
      1. Getting ready
      2. How to do it...
      3. How it works...
    16. Configuring MAVEN_HOME in Jenkins
      1. Getting ready
      2. How to do it...
      3. How it works...
    17. Configuring GRADLE_HOME in Jenkins
      1. Getting ready
      2. How to do it...
      3. How it works...
    18. Creating a Freestyle job for Ant Project
      1. Getting ready
      2. How to do it...
      3. How it works...
    19. Creating a Maven Job for Maven Project
      1. Getting ready
      2. How to do it...
      3. How it works...
  3. Management and Monitoring of Jenkins
    1. Understanding master/agent architecture
      1. Getting ready
      2. How to do it...
    2. Managing Jenkins build jobs using Eclipse
      1. Getting ready
      2. How to do it...
    3. Backing up and restoring Jenkins
      1. Getting ready
      2. How to do it...
      3. See also
    4. Command-line options in Jenkins using Jenkins CLI
      1. Getting ready
      2. How to do it...
    5. Modifying the Jenkins configuration from the command line
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Managing disk usage
      1. Getting ready
      2. How to do it...
      3. See also
    7. Shutdown Jenkins safely
      1. Getting ready
      2. How to do it...
    8. Monitoring Jenkins with JavaMelody
      1. Getting ready
      2. How to do it...
      3. There's more...
        1. Troubleshooting with JavaMelody - memory
        2. Troubleshooting with JavaMelody - painful jobs
    9. Monitoring a Jenkins Job using a Build Monitor View
      1. Getting ready
      2. How to do it...
    10. Configuring mail notifications
      1. Getting ready
      2. How to do it...
    11. Signaling the need to archive
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
  4. Managing Security
    1. Introduction
    2. Improving security with Jenkins configuration
      1. Getting ready
      2. How to do it...
    3. Configuring Authorization - Matrix-based security
      1. Getting ready
      2. How to do it...
    4. Configuring a Project-based Matrix Authorization Strategy
      1. Getting ready
      2. How to do it...
    5. Jenkins and OpenLDAP integration
      1. Getting ready
      2. How to do it...
      3. There's more...
    6. Jenkins and Active Directory integration
      1. Getting ready
      2. How to do it...
    7. Jenkins and OWASP Zed Attack Proxy integration
      1. Getting ready
      2. How to do it...
      3. See also
    8. Testing for OWASP's top 10 security issues
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
        1. Target practice with WebGoat
        2. More tools of the trade
      5. See also
    9. Finding 500 errors and XSS attacks in Jenkins through fuzzing
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    10. Avoiding sign-up bots with JCaptcha
      1. Getting ready
      2. How to do it...
      3. How it works...
  5. Improving Code Quality
    1. Introduction
    2. Integrating Jenkins with SonarQube
      1. Getting ready...
      2. How to do it...
      3. There's more
    3. The updating center in SonarQube
      1. Getting ready
      2. How to do it...
      3. There's more...
    4. Quality gates, quality profiles, and rules
      1. How to do it...
    5. Verifying HTML, CSS and JavaScript validity using SonarQube
      1. Getting ready
      2. How to do it...
      3. There's more
    6. Verifying Java code using SonarQube
      1. Getting ready
      2. How to do it...
    7. Configuring SonarQube as a Windows service
      1. Getting ready
      2. How to do it...
      3. There's more
  6. Building Applications in Jenkins
    1. Introduction
    2. Configuring an Ant project for execution
      1. Getting ready
      2. How to do it...
      3. There's more...
    3. Configuring a Maven project for execution
      1. Getting ready
      2. How to do it...
    4. Configuring an Android project for execution
      1. Getting ready
      2. How to do it...
    5. Manipulating environmental variables
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    6. Running Ant through Groovy in Maven
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    7. Failed Jenkins jobs based on JSP syntax errors
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
        1. Different server types
        2. Eclipse templates for JSP pages
    8. Remotely triggering jobs through the Jenkins API
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
        1. Running jobs from within Maven
        2. Remotely generating jobs
      5. See also
  7. Continuous Delivery
    1. Introduction
    2. Archiving artifacts
      1. Getting ready
      2. How to do it...
      3. See also
    3. Copying an artifact from another build job
      1. Getting ready
      2. How to do it...
      3. There's more...
    4. Integrating Jenkins with Artifactory
      1. Getting ready
      2. How to do it...
    5. Deploying a WAR file from Jenkins to Tomcat
      1. Getting ready
      2. How to do it...
    6. Deploying a WAR file from Jenkins to AWS Beanstalk
      1. Getting ready
      2. How to do it...
    7. Deploying a WAR file from Jenkins to Azure App Services
      1. Getting ready
      2. How to do it...
    8. Promoting builds
      1. Getting ready
      2. How to do it...
  8. Continuous Testing
    1. Getting started with continuous testing
    2. Creating a Selenium test case using Eclipse
      1. Getting ready
      2. How to do it...
    3. Integrating Jenkins and Selenium for functional testing
      1. Getting ready
      2. How to do it...
      3. There's more
    4. Jenkins and Cucumber test reports
      1. Getting ready
      2. How to do it...
    5. Creating a load test in Apache JMeter
      1. Getting ready
      2. How to do it...
      3. There's more
    6. Executing a load test from Jenkins
      1. Getting ready
      2. How to do it...
    7. Reporting JMeter performance metrics
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    8. Testing with FitNesse
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. See also...
  9. Orchestration
    1. Introduction
    2. Understanding upstream and downstream jobs
      1. Getting ready
      2. How to do it...
    3. Configuring upstream and downstream jobs
      1. Getting ready
      2. How to do it...
    4. Configuring a build pipeline
      1. Getting ready
      2. How to do it...
    5. Creating a pipeline job
      1. Getting ready
      2. How to do it...
    6. Using a sample pipeline for execution
      1. Getting ready
      2. How to do it...
    7. Configuring a pipeline job for end-to-end automation
      1. Getting ready
      2. How to do it...
    8. Getting started with the Blue Ocean dashboard
      1. Getting ready
      2. How to do it...
  10. Jenkins UI Customization
    1. Introduction
    2. Skinning Jenkins with the simple themes plugin
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
        1. CSS 3
        2. Included JavaScript library frameworks
        3. Trust but verify
      5. There's more
      6. See also
    3. Skinning and provisioning Jenkins using a WAR overlay
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
        1. Which types of content can you replace?
        2. Search engines and robots.txt
      5. See also
    4. Generating a home page
      1. Getting ready
      2. How to do it...
    5. Creating HTML reports
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    6. Efficient use of views
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    7. Saving screen space with the Dashboard View plugin
      1. Getting ready
      2. How to do it...
      3. There's more...
      4. See also
    8. Making noise with HTML5 browsers
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    9. An extreme view for reception areas
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
  11. Processes that Improve Quality
    1. Culture and collaboration
    2. Fail early or fail faster
    3. Data-driven testing
    4. Learning from history
    5. Considering test automation as a software project
    6. Visualize, visualize, and visualize!
    7. Conventions are good
    8. Test frameworks and commercial choices are increasing
    9. Offsetting work to Jenkins nodes
    10. Starving QA/integration servers
    11. Reading the change log of Jenkins
    12. Avoiding human bottlenecks
    13. Avoiding groupthink
    14. Training and community
    15. Visibly rewarding successful developers
    16. Stability and code maintenance
    17. Resources on quality assurance
    18. And there's always more
    19. Final comments