Free Sample
+ Collection

Jenkins Continuous Integration Cookbook

Alan Mark Berg

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.
RRP $26.99
RRP $44.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781849517409
Paperback344 pages

About This Book

  • 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

Who This Book Is For

If you are a Java developer, software architect, technical project manager, build manager, or development or QA engineer, this book is for you.

You should have a basic understanding of the Software Development Life Cycle and Java development, as well as a rudimentary understanding of Jenkins.

Table of Contents

Chapter 1: Maintaining Jenkins
Using a sacrificial Jenkins instance
Backing up and restoring
Modifying Jenkins configuration from the command line
Reporting overall disc usage
Deliberately failing builds through log parsing
A Job to warn about the disc usage violations through log parsing
Keeping in contact with Jenkins through Firefox
Monitoring through JavaMelody
Keeping a track of the script glue
Scripting the Jenkins command-line interface
Global modifications of Jobs with Groovy
Signaling the need to archive
Chapter 2: Enhancing Security
Testing for OWASP's top ten security issues
Finding 500 errors and XSS attacks in Jenkins through fuzzing
Improving security via small configuration changes
Looking at the Jenkins user through Groovy
Working with the Audit Trail plugin
Installing OpenLDAP with a test user and group
Using Script Realm authentication for provisioning
Reviewing project-based matrix tactics via a custom group script
Administering OpenLDAP
Configuring the LDAP plugin
Installing a CAS server
Enabling SSO in Jenkins
Chapter 3: Building Software
Plotting alternative code metrics in Jenkins
Running Groovy scripts through Maven
Manipulating environmental variables
Running AntBuilder through Groovy in Maven
Failing Jenkins Jobs based on JSP syntax errors
Configuring Jetty for integration tests
Looking at license violations with RATs
Reviewing license violations from within Maven
Exposing information through build descriptions
Reacting to the generated data with the Post-build Groovy plugin
Remotely triggering Jobs through the Jenkins API
Adaptive site generation
Chapter 4: Communicating through Jenkins
Skinning Jenkins with the Simple Theme plugin
Skinning and provisioning Jenkins using a WAR overlay
Generating a home page
Creating HTML reports
Efficient use of views
Saving screen space with the Dashboard plugin
Making noise with HTML5 browsers
An eXtreme view for reception areas
Mobile presentation using Google Calendar
Tweeting the world
Mobile apps for Android and iOS
Getting to know your audience with Google Analytics
Chapter 5: Using Metrics to Improve Quality
Estimating the value of your project through Sloccount
Looking for "smelly" code through code coverage
Activating more PMD rulesets
Creating custom PMD rules
Finding bugs with FindBugs
Enabling extra FindBugs rules
Finding security defects with FindBugs
Verifying HTML validity
Reporting with JavaNCSS
Checking style using an external pom.xml
Faking checkstyle results
Integrating Jenkins with Sonar
Chapter 6: Testing Remotely
Deploying a WAR file from Jenkins to Tomcat
Creating multiple Jenkins nodes
Testing with Fitnesse
Activating Fitnesse HtmlUnit Fixtures
Running Selenium IDE tests
Triggering Failsafe integration tests with Selenium Webdriver
Creating JMeter test plans
Reporting JMeter performance metrics
Functional testing using JMeter assertions
Enabling Sakai web services
Writing test plans with SoapUI
Reporting SoapUI test results
Chapter 7: Exploring Plugins
Personalizing Jenkins
Testing and then promoting
Fun with pinning JS Games
Looking at the GUI Samples plugin
Changing the help of the file system scm plugin
Adding a banner to Job descriptions
Creating a RootAction plugin
Exporting data
Triggering events on startup
Triggering events when web content changes
Reviewing three ListView plugins
Creating my first ListView plugin

What You Will Learn

  • Maintain and secure Jenkins
  • Integrate Jenkins with LDAP and SSO solutions
  • Run an integration server to fire automatic functional and performance tests
  • Communicate through social media and plot custom data
  • Skin Jenkins to your corporate look and feel
  • Refine the use of code metrics to improve quality
  • Write your first custom Jenkins plugin
  • Apply several tweaks to optimize your use of Jenkins

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.


Read More