For online information and ordering of these and other Manning books, please visit www.manning.com. The publisher offers discounts on these books when ordered in quantity.
Manning Publications Co.
2021 by Manning Publications Co. All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps.
Recognizing the importance of preserving what has been written, it is Mannings policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15 percent recycled and processed without the use of elemental chlorine.
front matter
preface
Ten years ago, I wrote my first makefile to automate the testing, building, and deployment of a C++ application. Three years later, while working as a consultant, I came across Jenkins and Docker and discovered how to take my automation skills to the next level with CI/CD principles.
The beauty of CI/CD is that its simply a rigorous way of recording what youre already doing. It doesnt fundamentally change how you do something, but it encourages you to record each step in the development process, enabling you and your team to reproduce the entire workflow later at scale. Over the next few months, I started writing blog posts, doing talks, and contributing to CI/CD-related tools.
However, setting up a CI/CD workflow has always been a very manual process for me. It was done via defining a series of individual jobs for the various pipeline tasks through a graphical interface. Each job was configured via web formsfilling in text boxes, selecting entries from drop-down lists, and so forth. And then the series of jobs were strung together, each triggering the next, into a pipeline. This made the troubleshooting experience a nightmare and reverting to the last known configuration in case of failure a tedious operation.
A few years later, the pipeline-as-code practice emerged as part of a larger as code movement that includes infrastructure as code. I could finally configure builds, tests, and deployment in code that is trackable and stored in a centralized Git repository. All the previous pains were alleviated.
I became a fan and believer of pipeline as code, as I transitioned from being a software engineer, tech leader, and senior DevOps manager to now co-leading my first startup as CTO. Pipeline as code became an important part of each project I was part of.
I had the chance to work on different types of architecturefrom monolithic, to microservices, to serverless applicationshaving built and maintained CI/CD pipelines for large-scale applications. Along the way, I accumulated tips and best practices to follow while going through the journey of continuous everything.
The idea of sharing that experience is what triggered this book. Implementing pipeline as code is challenging for many teams, as they require the use of many tools and processes that all work together. The learning curve takes a lot of time and effort, leading people to wonder whether its worth it. This book is a handbook experience on how to build a CI/CD pipeline from scratch, using the most widely adopted CI solution: Jenkins. I hope the result will help you embrace the new paradigm of building CI/CD pipelines.
acknowledgments
First and foremost, I want to thank my wife, Mounia. Youve always supported me, always patiently listened while I struggled to get this done, and always made me believe I could finish this. I love you.
Next, Id like to acknowledge my editor at Manning, Karen Miller. Thank you for working with me, and thank you more for being patient when things got rough during the pandemic. Your commitment to the quality of this book has made it better for everyone who reads it. Thanks as well to all the other folks at Manning who worked with me on the production and promotion of the book: Deirdre Hiam, my project editor, Sharon Wilkey, my copyeditor, Keri Hales, my proofreader, and Mihaela Batini, my reviewing editor. It was truly a team effort.
Finally, Id like to thank my family, including my parents and brothers, for finding the inner strength to listen to me talk about the book at every gathering.
To all the reviewers: Alain Lompo, Alex Koutmos, Andrea Carlo Granata, Andres Damian Sacco, Bjrn Neuhaus, Clifford Thurber, Conor Redmond, Giridharan Kesavan, Gustavo Filipe Ramos Gomes, Iain Campbell, Jerome Meyer, John Guthrie, Kosmas Chatzimichalis, Maciej Drodowski, Matthias Busch, Michal Rutka, Michele Adduci, Miguel Montalvo, Naga Pavan Kumar Tikkisetty, Ryan Huber, Satej Kumar Sahu, Simeon Leyzerzon, Simon Seyag, Steve Atchue, Tahir Awan, Theo Despoudis, Ubaldo Pescatore, Vishal Singh, and Werner Dijkerman, your suggestions helped make this a better book.
about this book
Pipeline as Code was designed to be a hands-on experience through practical examples. It will teach you the ins and outs of Jenkins and be your best companion to build a solid CI/CD pipeline for cloud-native applications.