This document discusses managing Jenkins jobs using Job DSL, which allows configuring Jenkins jobs through code rather than through the Jenkins UI. It provides examples of using Job DSL to generate jobs from scripts, adding common utility methods, extending jobs with custom XML, and monkey patching to add new features to Job DSL entities. Job DSL treats job configuration as code that is versioned, simplified, and avoids duplicating code.
1. Manage your jobs with Job DSL
Niels Bech Nielsen, 9consult
nbn@nine.dk
2. Services
Public Services
Professional Services
Projects & DevOps
Application Management
Architecture
Security
Open Source
3. 3
>sed –i s/bug/feature/g *
>git commit -a -m ”Fixed”
Happy
Customer
Continuous Integration X–Mas Pipeline
One Button
Deployment
Circle of Software Development
4. 4
How do you manage changes in your Pipelines?
X
?
5. 5
Project A
How do you manage changes in your Pipelines?
• Commit
• Regression
tests
• Integration
Tests
• Q+A
• Deployment
Project B
• Commit
• Nightly
Release
• Regression
tests
• Q+A
• Deployment
Project C
• Commit
• Integration
Tests
• Test Deploy
• Acceptance
Tests
• Q+A
• Deployment
6. 6
Options include
• Template Project Plugin
• Job Generator Plugin
• Parameterized Build Plugin
• … (your own homegrown solution or click-edit)
• Job DSL Plugin
7. 7
Configuration as Code
• Treat your configuration as Code
Versioned
Simplified
DRY
• Job DSL provide a simple, intuitive
Groovy DSL to create Jenkins jobs
from scripts
Generate all your jobs from a ’seed’
job
Abstract utility functions
Supports all Jenkins plugins through
extension
• NO MORE HTML EDITING
8. 8
Photo Credits
• Nerd – Stephanie Klocke
• Happy Customer – VeganSoldier
• Fujii and Pri – Marcelo Jorge Vieria
• Jenkins without broken builds – Henrique Imbertti Jr
• Antares Rocket Test Launch – NASA
• Launch Button – Steven Depolo
• Etsy Jenkins Cluster – Noah Sussman