Preface

How to Use This Book

This book is big—bigger than I ever thought it would be. I’ve worried about this at some level, but decided that there were two ways to go when writing it: I could either limit the content to only what was needed to do a basic tutorial, or I could spend some time explaining concepts, creating code examples, and diving into what terminology, functions, and programming with pipelines-as-code really mean. If you’ve scanned the book, you can probably figure out that I opted to do the latter.

My reasoning for that was due to my experiences over many years of training people on using Jenkins. In a short class or workshop, we could only cover a small number of topics. And people were always hungry for more—more detail and more examples that they could apply. At the end of conference presentations, I would invariably get lines of people asking for more information sources, examples, and where to find info about such and such. Oftentimes, it would come down to “Google this” or “See this question on Stack Overflow.” Nothing wrong with that, but also not the most convenient approach.

This book is intended to help you find answers on how to use this powerful technology. Granted, it’s more mechanics than DevOps, but chances are if you are reading this, you already have some grasp of continuous integration (CI), continuous deployment (CD), DevOps, and Jenkins, and are looking for how to make the most out of the new Jenkins features.

So here are a few guidelines (feel free to use them or ignore them as fits your situation):

  • Don’t try to read the entire book through—unless you need to get a lot of sleep.

  • Scan the sections listed in the Table of Contents. A chapter’s title only hints at its full contents. Also, don’t forget about consulting the index to find topics you might be interested in.

  • If you want to understand the basic ideas and get going quickly, read the first two chapters and then start playing with some basic pipelines. As you run into questions or problems, consult the appropriate chapters in the book for the particular areas.

  • If you already know the basics of Jenkins and want to convert to pipelines-as-code, take a look at Chapter 10 to get some ideas on conversions and then consult other chapters as needed.

  • If you’re looking to create a larger pipeline, take a look at the chapter on conversions and the various chapters on integration with the OS and other technologies (Chapters 1014). And don’t forget about security—there’s a chapter on that, too (Chapter 5).

  • If you’re looking to automate Jenkins, take a look at Chapter 15.

  • If you run into problems, each chapter contains some details that may help. Look at the notes, warnings, and sidebars for information on unusual situations or functionality that may trip you up (or provide an advantage you hadn’t thought about). There’s also a chapter on more general troubleshooting at the end of the book.

I freely acknowledge the problem with any technical book these days: that the technology is rapidly evolving. Over the course of writing the chapters for the book, I’ve gone back and tried to keep up with the latest changes and innovations and revised as appropriate. It is my firm belief that the material in the book will provide you with a good foundation and reference for working with Jenkins 2. But, of course, you should always consult the latest community documentation for updates and new innovations.

Finally, a request—even if you don’t need to read most of the book, if you find the parts you read useful, please take a moment and post a review. The main way people find out about useful books is by word of mouth and online reviews. Your review can have a tremendous impact.

Thank you, and I hope to see you in a future training or conference!

Conventions Used in This Book

The following typographical conventions are used in this book:

Italic

Indicates new terms, URLs, email addresses, filenames, and file extensions.

Constant width

Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.

Constant width bold

Shows commands or other text that should be typed literally by the user.

<Constant width in angle brackets>

Shows text that should be replaced with user-supplied values or by values determined by context.

Tip

This element signifies a tip or suggestion.

Note

This element signifies a general note.

Warning

This element indicates a warning or caution.

Using Code Examples

Supplemental material (code examples, exercises, etc.) is available for download at https://resources.oreilly.com/examples/0636920064602.

This book is here to help you get your job done. In general, if example code is offered with this book, you may use it in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Jenkins 2: Up and Running by Brent Laster (O’Reilly). Copyright 2018 Brent Laster, 978-1-491-97959-4.”

If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at .

Important Note About Code Examples in This Book

In many cases where code listings occur in the book, individual lines of the code are too long to fit in the printed space. In those cases, the code is wrapped around and continued on the next line(s). There are generally not line continuation characters on these lines. However, you can usually tell where code has been continued from the line above by the semantics of the command or by the indentation.

A Note About the Figures in This Book

Many screenshots and figures have been used throughout this book to help clarify information for the reader. The quality and scaling of some visual elements may vary depending on the methods used to capture them. As well, since the Jenkins community frequently releases updated versions of the application and its plugins, visual representations shown in the book are subject to change.

O’Reilly Safari

Note

Safari (formerly Safari Books Online) is a membership-based training and reference platform for enterprise, government, educators, and individuals.

Members have access to thousands of books, training videos, Learning Paths, interactive tutorials, and curated playlists from over 250 publishers, including O’Reilly Media, Harvard Business Review, Prentice Hall Professional, Addison-Wesley Professional, Microsoft Press, Sams, Que, Peachpit Press, Adobe, Focal Press, Cisco Press, John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, and Course Technology, among others.

For more information, please visit http://oreilly.com/safari.

How to Contact Us

Please address comments and questions concerning this book to the publisher:

  • O’Reilly Media, Inc.
  • 1005 Gravenstein Highway North
  • Sebastopol, CA 95472
  • 800-998-9938 (in the United States or Canada)
  • 707-829-0515 (international or local)
  • 707-829-0104 (fax)

We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at http://bit.ly/jenkins-2-ur.

To comment or ask technical questions about this book, send email to .

For more information about our books, courses, conferences, and news, see our website at http://www.oreilly.com.

Find us on Facebook: http://facebook.com/oreilly

Follow us on Twitter: http://twitter.com/oreillymedia

Watch us on YouTube: http://www.youtube.com/oreillymedia

Acknowledgments

The biggest thanks of all for this book has to go to the Jenkins community. Jenkins is proof that community-developed and community-supported software can be of incredible utility, versatility, and quality. To all those who have contributed to Jenkins or played a role in developing plugins or training materials, answering questions, or getting releases of Jenkins out, thank you.

On the individual side, there are many people to thank. The only way I can think to do this is via some broad categories.

Thank you to Kohsuke Kawaguchi for creating Hudson—and then Jenkins—and agreeing to write the foreword for this book. The technical drive and leadership you bring to Jenkins through the community and CloudBees has made a huge and positive difference in how we create and deliver software.

Thanks to the technical editors, Patrick Wolfe, Brian Dawson, and Chaim Krause. Their investment of time in agreeing to review this book was significant—and appreciated. The content is immeasurably better because of their feedback.

Patrick Wolfe has been instrumental in providing technical updates and additional information since the book’s early stages. This has helped to ensure that the book is, hopefully, up to date with the current state of Jenkins in most cases (at least at its release date). His input has been invaluable and I appreciate the time and openness that he has given to this project.

Brian Dawson has also been extremely helpful in noting changes and places where the book could be improved for Jenkins users. Though Brian and Patrick both work at CloudBees, they exemplify the focus of the company on freely giving back to the Jenkins community.

Chaim Krause is among the most dedicated people I know. Having worked with him on two books now, I always appreciate his effort and attention to detail. He takes the time to try things out and point out where wording or examples need updates or don’t make sense initially. There are a number of details in the book that owe their correctness to him.

A huge thanks to the staff at O’Reilly. First, thanks to Brian Foster, the editor who was willing to take a chance on this book and supported it all along the way. Thanks to Angela Rufino, who has helped keep the book on course, answered all of my questions, and provided the oversight to see the book through to completion. Thanks also to Nan Barber for her early work on the book editing.

Shoutouts as well to Dwight Ramsey and Rachel Head, the copyeditors, for making my writing readable and clear, and to Justin Billing, the production editor, and Jasmine Kwityn, the proofreader, for bringing everything together to create a final, polished product.

Much of the material in this book was first shared and honed in the live training classes I do for O’Reilly’s Safari platform and at conference workshops. Thanks to Susan Conant (along with Brian Foster again) for listening to my ideas for Jenkins 2 live trainings and helping develop them. Also, thanks to Virginia Wilson for the additional writing opportunities around CI and CD and to conference organizers Rachel Roumeliotis and Audra Carter for shepherding the conference sessions.

Finally at O’Reilly, I want to thank the training staff who have supported the many live training sessions I’ve done around Git and Jenkins. Thank you to Yasmina Greco, Lindsay Ventimiglia, Nurul Ishak, and Shannon Cutt for overseeing all of the trainings and keeping everything on track in such a professional manner.

I would be remiss if I did not also mention Jay Zimmerman on the conference side. Jay is the founder and organizer of the No Fluff Just Stuff conference series and first provided me an opportunity to speak at events all across the country on Jenkins.

Thanks to the management at SAS for supporting my initiatives to create and present corporate training courses over the years to employees across the company and around the world. I especially thank Glenn Musial, Cyndi Schnupper, and Andy Diggelmann for their encouragement and support of my endeavors.

To everyone who’s attended one of my trainings or workshops on Jenkins, thanks—especially to those who have asked a question and/or provided feedback to cause me to think more about topics and ways to improve content.

To those at CloudBees, acting on behalf of the Jenkins community to evolve Jenkins, answer questions, and provide documentation for all of us as users, your efforts are appreciated. There are too many to list them all, but several names have come up repeatedly as I researched material for the book, including Patrick Wolfe, Jessie Glick, Andrew Bayer, James Dumay, Liam Newman, and James Brown. If you see content by these guys, read it and you will likely learn something useful. Also thanks to Max Arbuckle for his coordination of the Jenkins World conferences, where much of the information about Jenkins 2 was first presented.

The deepest gratitude of all must go to my wife, Anne-Marie, and to my children. This book was written over a long period of time, mostly nights and weekends, which took time away from them while I wrote about something that seemed very foreign to them. Nevertheless, they never failed in their words of encouragement. Anne-Marie, you have been my greatest support and source of strength and encouragement, as you are in everything. Thank you for that and for helping me keep a sense of order and balance between life, dreams, and work. You bring me kindness, love, and inspiration each and every day of our lives together, and for that I am truly grateful.

Finally, thanks to the readers of this book. It is my sincere hope that you will get value out of it and it will help you make progress in your use of Jenkins and all the related pieces.

Get Jenkins 2: Up and Running now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.