You are previewing Jenkins Continuous Integration Cookbook.
O'Reilly logo
Jenkins Continuous Integration Cookbook

Book Description

There are literally hundreds of plugins available for Jenkins, so a guide to what’s worthwhile is essential. This book shows you how to utilize third-party plugins and create your own, all with a straightforward, problem-solution approach.

  • Explore the use of more than 40 best of breed plugins

  • Use code quality metrics, integration testing through functional and performance testing to measure the quality of your software

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

  • In Detail

    Jenkins is a highly popular continuous integration server. Its correct use supports a quality software development process. Jenkins is great at finding issues in software early and communicating it to a wide audience. Jenkins is also easily extendable with a simple framework for writing plugins. Currently there are over 400 plugins available for inclusion.

    Jenkins Continuous Integration Cookbook has over 80 recipes describing practical ways to use Jenkins and expanding its feature set by selective use of the best of breed plugins. Jenkins has a simple framework for writing plugins. There are over 400 plugins available. Therefore, it is easy to get lost in possibilities. Using practical recipes, this book will guide you through the complexities. The recipes are bundled into themes including security, maintainability, communication, building software, the valid use of code metrics, testing remotely, and writing your first plugin.

    Jenkins Continuous Integration Cookbook includes problem solving and how to do recipes for many common and less common tasks. A wide range of topics are covered from integrating, securing, and maintaining Jenkins in your organization to writing your first extension.

    The book begins with common maintenance tasks followed by securing Jenkins and enabling SSO. Then it explores the relationship between Jenkins builds and the Maven pom.xml. You will then learn ways to effectively communicate with various target audiences (developers, project managers, the public). You will then explore source code metrics with related recipes, and set up and run remote stress and functional tests. The book finally lists a series of 11 interesting plugins with a concluding recipe on how to create your first plugin.

    Jenkins Continuous Integration Cookbook describes solutions and optimizations to problems commonly found.

    Table of Contents

    1. Jenkins Continuous Integration Cookbook
      1. Jenkins Continuous Integration Cookbook
      2. Credits
      3. About the Author
      4. About the Reviewers
      5. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      6. 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. Errata
          3. Piracy
          4. Questions
      7. 1. Maintaining Jenkins
        1. Introduction
        2. Using a sacrificial Jenkins instance
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Backing up and restoring
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Checking for permission errors
            2. Testing exclude patterns
          5. See also
        4. Modifying Jenkins configuration from the command line
          1. Getting ready
          2. How to do it...
            1. How it works...
            2. There's more...
              1. Turning off security
              2. Finding JavaDoc for custom plugin extensions
              3. The effects of adding garbage
            3. See also
          3. Reporting overall disc usage
            1. Getting ready
            2. How to do it...
            3. How it works...
            4. There's more...
            5. See also
          4. Deliberately failing builds through log parsing
            1. Getting ready
            2. How to do it...
            3. How it works...
            4. There's more...
            5. See also
          5. A Job to warn about the disc usage violations through log parsing
            1. Getting ready
            2. How to do it...
            3. How it works...
            4. There's more...
            5. See also
          6. Keeping in contact with Jenkins through Firefox
            1. Getting ready
            2. How to do it...
            3. How it works...
            4. There's more...
            5. See also
          7. Monitoring through JavaMelody
            1. Getting ready
            2. How to do it...
            3. How it works...
            4. There's more...
              1. Troubleshooting with JavaMelody - memory
              2. Troubleshooting with JavaMelody - painful Jobs
            5. See also
          8. Keeping a track of the script glue
            1. Getting ready
            2. How to do it...
            3. How it works...
            4. There's more...
            5. See also
          9. Scripting the Jenkins command-line interface
            1. Getting ready
            2. How to do it...
            3. How it works...
            4. There's more...
            5. See also
          10. Global modifications of Jobs with Groovy
            1. Getting ready
            2. How to do it...
            3. How it works...
            4. There's more...
            5. See also
          11. Signaling the need to archive
            1. Getting ready
            2. How to do it...
            3. How it works...
            4. There's more...
            5. See also
      8. 2. Enhancing Security
        1. Introduction
        2. Testing for OWASP's top ten 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
        3. 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
        4. Improving security via small configuration changes
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. Looking at the Jenkins user through Groovy
          1. Getting ready
          2. How to do it...
            1. How it works...
            2. There's more...
            3. See also
          3. Working with the Audit Trail plugin
            1. Getting ready
            2. How to do it...
            3. How it works...
            4. There's more...
              1. A complementary plugin — JobConfigHistory
              2. Missing Audit Logs
              3. Swatch
            5. See also
          4. Installing OpenLDAP with a test user and group
            1. Getting ready
            2. How to do it...
            3. How it works...
            4. There's more...
            5. See also
          5. Using Script Realm authentication for provisioning
            1. Getting ready
            2. How to do it...
            3. How it works...
            4. There's more...
            5. See also
          6. Reviewing project-based matrix tactics via a custom group script
            1. Getting ready
            2. How to do it...
            3. How it works...
            4. There's more...
              1. My own custom security flaw
              2. Static code review, tainting, and untainting
            5. See also
          7. Administering OpenLDAP
            1. Getting ready
            2. How to do it...
              1. How it works...
              2. There's more...
              3. See also
            3. Configuring the LDAP plugin
              1. Getting ready
              2. How to do it...
              3. How it works...
              4. There's more...
                1. The difference between misconfiguration and bad credentials
                  1. Searching
                2. See also
              5. Installing a CAS server
                1. Getting ready
                2. How to do it...
                3. How it works...
                4. There's more...
                  1. Backend authentication
                  2. An alternative installation recipe using ESUP CAS
                  3. Trusting LDAP SSL
                  4. A few useful resources
                5. See also
              6. Enabling SSO in Jenkins
                1. Getting ready
                2. How to do it...
                3. How it works...
                4. See also
      9. 3. Building Software
        1. Introduction
          1. A template pom.xml
          2. Setting up a File System SCM
        2. Plotting alternative code metrics in Jenkins
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Running Groovy scripts through Maven
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Keeping track of warnings
            2. Where's my source?
            3. Maven phases
          5. See also
        4. Manipulating environmental variables
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. Running AntBuilder through Groovy in Maven
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        6. Failing 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
          5. See also
        7. Configuring Jetty for integration tests
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        8. Looking at license violations with RATs
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        9. Reviewing license violations from within Maven
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Multiple approaches and anti-patterns
            2. Snapshots
          5. See also
        10. Exposing information through build descriptions
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        11. Reacting to the generated data with the Post-build Groovy plugin
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        12. 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
        13. Adaptive site generation
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Searching for example site generation configuration
            2. Maven 2 and Maven 3 - differences
          5. See also
      10. 4. Communicating through Jenkins
        1. Introduction
        2. Skinning Jenkins with the Simple Theme 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. 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...
          3. How it works...
          4. There's more...
          5. See also
        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 plugin
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. 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
        10. Mobile presentation using Google Calendar
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        11. Tweeting the world
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        12. Mobile apps for Android and iOS
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Android 1.6 and Hudson apps
            2. VirtualBox and the Android-x86 project
          5. See also
        13. Getting to know your audience with Google Analytics
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
      11. 5. Using Metrics to Improve Quality
        1. Introduction
        2. Estimating the value of your project through Sloccount
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Software cost estimation
            2. Goodbye Google code search, hello Koders.com
          5. See also
        3. Looking for "smelly" code through code coverage
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        4. Activating more PMD rulesets
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Throttling down PMD rulesets
            2. The "don't repeat yourself" principle
          5. See also
        5. Creating custom PMD rules
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        6. Finding bugs with FindBugs
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. The FindBugs Eclipse plugin
            2. The Xradar and Maven dashboards
          5. See also
        7. Enabling extra FindBugs rules
          1. Getting ready
          2. How to do it...
          3. There's more...
          4. How it works...
          5. See also
        8. Finding security defects with FindBugs
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        9. Verifying HTML validity
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        10. Reporting with JavaNCSS
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        11. Checking style using an external pom.xml
        12. Getting ready
        13. How to do it...
        14. How it works...
        15. There's more...
        16. See also
        17. Faking checkstyle results
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        18. Integrating Jenkins with Sonar
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Sonar plugins
            2. Aggregating results using the Violations plugin
          5. See also
      12. 6. Testing Remotely
        1. Introduction
        2. Deploying a WAR file from Jenkins to Tomcat
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Creating multiple Jenkins nodes
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Testing with Fitnesse
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. Activating Fitnesse HtmlUnit Fixtures
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        6. Running Selenium IDE tests
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        7. Triggering Failsafe integration tests with Selenium Webdriver
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        8. Creating JMeter test plans
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        9. Reporting JMeter performance metrics
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        10. Functional testing using JMeter assertions
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        11. Enabling Sakai web services
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        12. Writing test plans with SoapUI
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        13. Reporting SoapUI test results
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
      13. 7. Exploring Plugins
        1. Introduction
        2. Personalizing Jenkins
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Testing and then promoting
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Fun with pinning JS Games
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. Looking at the GUI Samples plugin
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        6. Changing the help of the file system scm plugin
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        7. Adding a banner to Job descriptions
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        8. Creating a RootAction plugin
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        9. Exporting data
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        10. Triggering events on startup
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        11. Triggering events when web content changes
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
        12. Reviewing three ListView plugins
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        13. Creating my first ListView plugin
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
      14. A. Processes that Improve Quality
        1. Avoiding group think
        2. Considering test automation as a software project
        3. Offsetting work to Jenkins nodes
        4. Learning from history
        5. Test frameworks are emerging
        6. Starve QA/ integration servers
        7. And there's always more
        8. Final comments