Extending Jenkins

Book description

Get a complete walkthrough of the many interfaces available in Jenkins with the help of real-world examples to take you to the next level with Jenkins

About This Book

  • Find out how to interact with Jenkins from within Eclipse, NetBeans, and IntelliJ IDEA
  • Develop custom solutions that act upon Jenkins information in real time
  • A step-by-step, practical guide to help you learn about extension points in existing plugins and how to build your own plugin

Who This Book Is For

This book is aimed primarily at developers and administrators who are interested in taking their interaction and usage of Jenkins to the next level.

The book assumes you have a working knowledge of Jenkins and programming in general, and an interest in learning about the different approaches to customizing and extending Jenkins so it fits your requirements and your environment perfectly.

What You Will Learn

  • Retrieve and act upon Jenkins information in real time
  • Find out how to interact with Jenkins through a variety of IDEs
  • Develop your own Form and Input validation and customization
  • Explore how Extension points work, and develop your own Jenkins plugin
  • See how to use the Jenkins API and command-line interface
  • Get to know how to remotely update your Jenkins configuration
  • Design and develop your own Information Radiator
  • Discover how Jenkins customization can help improve quality and reduce costs

In Detail

Jenkins CI is the leading open source continuous integration server. It is written in Java and has a wealth of plugins to support the building and testing of virtually any project. Jenkins supports multiple Software Configuration Management tools such as Git, Subversion, and Mercurial.

This book explores and explains the many extension points and customizations that Jenkins offers its users, and teaches you how to develop your own Jenkins extensions and plugins.

First, you will learn how to adapt Jenkins and leverage its abilities to empower DevOps, Continuous Integration, Continuous Deployment, and Agile projects. Next, you will find out how to reduce the cost of modern software development, increase the quality of deliveries, and thereby reduce the time to market. We will also teach you how to create your own custom plugins using Extension points.

Finally, we will show you how to combine everything you learned over the course of the book into one real-world scenario.

Style and approach

Extending Jenkins explores and explains advanced Jenkins functionality from a practical point of view, teaching you real-world skills that will help you get more from this powerful software. Each key topic is explained clearly with a practical example, and in sufficient detail so you understand the concepts and can then develop your own solutions using your preferred software and languages.

Table of contents

  1. Extending Jenkins
    1. Table of Contents
    2. Extending Jenkins
    3. Credits
    4. About the Author
    5. About the Reviewer
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. 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
    8. 1. Preparatory Steps
      1. Getting started with Jenkins
      2. Extending the basic setup
      3. Jenkins evolution
      4. Continuous Integration with Jenkins
      5. Summary
    9. 2. Automating the Jenkins UI
      1. Use case scenario 1 – a large number of jobs
      2. Use case scenario 2 – multiple hosts
      3. Use case scenario 3 – helping your users through UI automation
      4. Use case scenario 4 – UI tweaks
      5. Summary
    10. 3. Jenkins and the IDE
      1. Eclipse and Mylyn
      2. Installing Mylyn
        1. Mylyn and Jenkins configurations
      3. IntelliJ IDEA and Jenkins build connectors
      4. NetBeans
      5. Summary
    11. 4. The API and the CLI
      1. Creating an Information Radiator with the Jenkins XML API
      2. Getting the information from Jenkins
      3. Automating the job
      4. Radiating the information
      5. Jenkins as a web server – the userContent directory
      6. The Jenkins CLI
        1. How to set it up
        2. How to use it
        3. Triggering remote jobs via the CLI
        4. Updating Jenkins configuration
      7. Summary
    12. 5. Extension Points
      1. A brief history of Jenkins plugins
      2. Interfaces
      3. Abstract classes
      4. Abstraction and interfaces
      5. Singletons
      6. Declaring an extension in Jenkins
      7. Summary
    13. 6. Developing Your Own Jenkins Plugin
      1. An introduction to Maven
      2. Installing Maven
      3. Summary
    14. 7. Extending Jenkins Plugins
      1. Where to start?
      2. Looking at the list of existing plugins
      3. A new build type required
      4. Loading and building our starting point
      5. The Builder class and Stapler
      6. Jelly and Jenkins
      7. Help
      8. Properties files and Messages
      9. The POM file
      10. Plugin progress
      11. Summary
    15. 8. Testing and Debugging Jenkins Plugins
      1. Running tests with Maven
      2. Debugging Jenkins
        1. Server debugging – a quick recap
        2. Debugging with IntelliJ
        3. Debugging with Eclipse
        4. mvnDebug
      3. The Jenkins Logger Console
      4. Summary
    16. 9. Putting Things Together
      1. The Jenkins script console and Groovy
      2. Groovy and Gradle as alternatives
      3. Jenkins and Docker
        1. Docker in Jenkins
        2. Jenkins in Docker
      4. Jenkins and Android
      5. Jenkins and iOS
      6. Keeping your Jenkins version and plugins up to date
      7. Summary
    17. Index

Product information

  • Title: Extending Jenkins
  • Author(s): Donald Simpson
  • Release date: December 2015
  • Publisher(s): Packt Publishing
  • ISBN: 9781785284243