Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Continuous Integration with Jenkins

You're reading from   Learning Continuous Integration with Jenkins An end-to-end guide to creating operational, secure, resilient, and cost-effective CI/CD processes

Arrow left icon
Product type Paperback
Published in Jan 2024
Publisher Packt
ISBN-13 9781835087732
Length 396 pages
Edition 3rd Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Nikhil Pathania Nikhil Pathania
Author Profile Icon Nikhil Pathania
Nikhil Pathania
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Part 1: The Concepts FREE CHAPTER
2. Chapter 1: The What, How, and Why of Continuous Integration 3. Part 2: Engineering the CI Ecosystem
4. Chapter 2: Planning, Deploying, and Maintaining Jenkins 5. Chapter 3: Securing Jenkins 6. Chapter 4: Extending Jenkins 7. Chapter 5: Scaling Jenkins 8. Part 3: Crafting the CI Pipeline
9. Chapter 6: Enhancing Jenkins Pipeline Vocabulary 10. Chapter 7: Crafting AI-Powered Pipeline Code 11. Chapter 8: Setting the Stage for Writing Your First CI Pipeline 12. Chapter 9: Writing Your First CI Pipeline 13. Part 4: Crafting the CD Pipeline
14. Chapter 10: Planning for Continuous Deployment 15. Chapter 11: Writing Your First CD Pipeline 16. Chapter 12: Enhancing Your CI/CD Pipelines 17. Index 18. Other Books You May Enjoy

Writing CI pipeline code

Our source code project contains a Jenkinsfile containing our CI pipeline code. It defines a Jenkins pipeline that can handle CI for our Hello World web application with both frontend and backend components. The pipeline integrates with Kubernetes, SonarQube, and Artifactory. Let’s look at the file section by section in detail.

Configuring Jenkins agent settings

In the context of declarative CI pipeline code, the agent { kubernetes {…} } section is pivotal. It designates that the Jenkins job should run within a Kubernetes environment. The agent section is responsible for defining where and how the entire pipeline or specific stages will be executed. By specifying kubernetes, we’re informing Jenkins to provision a fresh Kubernetes Pod for the job. This is particularly beneficial for scalability, as Pods are ephemeral and can be dynamically created and destroyed. It ensures that our CI tasks run in an isolated, consistent, and resource...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime