SlideShare a Scribd company logo
1 of 26
Download to read offline
Jenkins User Conference San Francisco #jenkinsconf
Supercharged Configuration As Code
Bulk Updates with Job DSL and System Groovy
Alan Beale
Chicago Trading Company
!
!
October 23, 2014
#jenkinsconf
Jenkins User Conference San Francisco #jenkinsconf
Who Am I
• Alan Beale
Build Engineer @ Chicago Trading Company
The statements, remarks and conclusions of this
presentation are my own and do not represent the views
of my employer, CTC Trading Group, L.L.C. (“CTC”).
Jenkins User Conference San Francisco #jenkinsconf
Have you ever found a
change that you need to
apply to 100 jobs?
Jenkins User Conference San Francisco #jenkinsconf
• Job DSL is a plugin that allows users to create job
configurations with a groovy domain specific
language
• System groovy scripts are groovy scripts that have
access the the Jenkins.instance calling various parts
of the Jenkins API
Jenkins User Conference San Francisco #jenkinsconf
Observations about build jobs
• Jobs Change over Time
• Most jobs are like other jobs
Jenkins User Conference San Francisco #jenkinsconf
Jobs Change Over Time
• Correctness Changes
• Bug Fixes
• Complexity Increase
Jenkins User Conference San Francisco #jenkinsconf
Most Jobs are Similar
• Small number of themes with structured variation
Jenkins User Conference San Francisco #jenkinsconf
Example of Job Themes
• Continuous Integration Jobs
• Gerrit Verification Jobs
• Release Jobs
• Privileged SCM Task Automation
Jenkins User Conference San Francisco #jenkinsconf
How do these observations help?
• Job DSL enables us to using coding techniques to
create job configurations
• System groovy scripts enable use to automate
repeated calls to jobs
Jenkins User Conference San Francisco #jenkinsconf
Player Piano
• Our metaphor for bulk job regeneration
Jenkins User Conference San Francisco #jenkinsconf
The Piano Roll
• Controls the sound of the piano
• Orchestrates the automation of job recreation
Jenkins User Conference San Francisco #jenkinsconf
Job DSL for gradle build
job {
name "git-gradle-simple-build"
scm {
git('/Users/alanbeale/sandbox/samples/java/basic',
'*/master' )
}
steps {
gradle ( "build", null, true )
}
}
Jenkins User Conference San Francisco #jenkinsconf
Evolution Example
job {
name "git-gradle-build-with-worspace-option"
scm {
git('/Users/alanbeale/sandbox/samples/java/basic',
‘*/master')
}
steps {
gradle ( "build", null, true
){ node -> //hudson.plugins.gradle.Gradle
node/useWorkspaceAsHome(true)
}
}
}
Jenkins User Conference San Francisco #jenkinsconf
Add Gerrit Trigger
• https://github.com/bealeaj1214/jenkins-juc-
job-dsl-bulk-regeneration/blob/master/src/
examples/jobdsl/scm-gradle-gerrit-build.jobDSL
Jenkins User Conference San Francisco #jenkinsconf
Repeated elements
• Job Name	

• Git URL	

• Gerrit Trigger Project
Jenkins User Conference San Francisco #jenkinsconf
Towards Job Factory
• Factor out common operations
• Parameterize calling Job DSL
Jenkins User Conference San Francisco #jenkinsconf
Create Utility class
• jobdsl.JobUtilities methods	

• setupGradleGerritJobName()	

• setupGerritScm()	

• setupGerritTrigger()	

• setupGradleBuild()
Jenkins User Conference San Francisco #jenkinsconf
JobUtilities.groovy
• https://github.com/bealeaj1214/jenkins-juc-
job-dsl-bulk-regeneration/blob/master/src/
main/groovy/jobdsl/JobUtilities.groovy
Jenkins User Conference San Francisco #jenkinsconf
generator job DSL
• https://github.com/bealeaj1214/jenkins-juc-
job-dsl-bulk-regeneration/blob/master/src/
generator/jobdsl/
seed4GradleGerritJobs.jobDSL
Jenkins User Conference San Francisco #jenkinsconf
Part 2 : System Groovy
Jenkins User Conference San Francisco #jenkinsconf
Regeneration script
import jenkins.model.*
!
import hudson.model.*
!
def jenkins = jenkins.model.Jenkins.instance
def jobGeneratorName='gradle-gerrit-job-generator'
def jobGenerator = jenkins.getItem(jobGeneratorName)
def projectParamName ='PROJECT_NAME'
def projectParamValue=‘sample/java/library'
!
if(jobGenerator){
boolean buildQueued =
jobGenerator.scheduleBuild( 5,
new Cause.UserIdCause(),
new ParametersAction(
new StringParameterValue(projectParamName, projectParamValue)
)
)
}
Jenkins User Conference San Francisco #jenkinsconf
Regenerate from existing job name
import jenkins.model.*
!
import hudson.model.*
!
def jenkins = jenkins.model.Jenkins.instance
def jobGeneratorName='gradle-gerrit-job-generator'
def jobGenerator = jenkins.getItem(jobGeneratorName)
def projectParamName ='PROJECT_NAME'
def jobs = jenkins.getItems()
!
def gerritJobs = jobs.findAll { job ->
job.name.endsWith('gradle-gerrit')
}
!
def projectNames =gerritJobs.collect { item ->
item.triggers.values().find {
it.class.simpleName =='GerritTrigger'
}. gerritProjects[0].pattern
}
!
if(jobGenerator){
projectNames.each { projectName ->
boolean buildQueued =
jobGenerator.scheduleBuild( 5,
new Cause.UserIdCause(),
new ParametersAction(
new StringParameterValue( projectParamName,projectName)
)
)
}
}
Jenkins User Conference San Francisco #jenkinsconf
Summary
• Job DSL enables precise control
• Define parameterized Job Generator (the piano)
Jenkins User Conference San Francisco #jenkinsconf
Summary
• System Groovy Jobs
• automates calling job generator in bulk
(piano roll)
Jenkins User Conference San Francisco #jenkinsconf
Thank You To Our Sponsors
Platinum Gold
Silver
Corporate
Jenkins User Conference San Francisco #jenkinsconf
Thank You
• Source Code at https://github.com/bealeaj1214/
jenkins-juc-job-dsl-bulk-regeneration

More Related Content

What's hot

Dockercon2015 bamboo
Dockercon2015 bambooDockercon2015 bamboo
Dockercon2015 bambooSteve Smith
 
Gradle - From minutes to seconds: minimizing build times
Gradle - From minutes to seconds: minimizing build timesGradle - From minutes to seconds: minimizing build times
Gradle - From minutes to seconds: minimizing build timesRene Gröschke
 
JUC Europe 2015: Orchestrating Your Pipelines with Jenkins, Python and the Je...
JUC Europe 2015: Orchestrating Your Pipelines with Jenkins, Python and the Je...JUC Europe 2015: Orchestrating Your Pipelines with Jenkins, Python and the Je...
JUC Europe 2015: Orchestrating Your Pipelines with Jenkins, Python and the Je...CloudBees
 
Stockholm Jenkins Area Meetup, March 2017
Stockholm Jenkins Area Meetup, March 2017Stockholm Jenkins Area Meetup, March 2017
Stockholm Jenkins Area Meetup, March 2017Andrey Devyatkin
 
GitHub Actions in action
GitHub Actions in actionGitHub Actions in action
GitHub Actions in actionOleksii Holub
 
Jfokus 2017 - The DevOps Disaster
Jfokus 2017 - The DevOps Disaster Jfokus 2017 - The DevOps Disaster
Jfokus 2017 - The DevOps Disaster Bert Jan Schrijver
 
Code review vs pull request
Code review vs pull requestCode review vs pull request
Code review vs pull requestBryan Liu
 
Automated android testing using jenkins ci
Automated android testing using jenkins ciAutomated android testing using jenkins ci
Automated android testing using jenkins cisveinungkb
 
Container based CI/CD on GitHub Actions
Container based CI/CD on GitHub ActionsContainer based CI/CD on GitHub Actions
Container based CI/CD on GitHub ActionsCasey Lee
 
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)Gareth Bowles
 
Next-gen DevOps engineering with Docker and Kubernetes by Antons Kranga
Next-gen DevOps engineering with Docker and Kubernetes by Antons KrangaNext-gen DevOps engineering with Docker and Kubernetes by Antons Kranga
Next-gen DevOps engineering with Docker and Kubernetes by Antons KrangaJavaDayUA
 
Practical continuous quality gates for development process
Practical continuous quality gates for development processPractical continuous quality gates for development process
Practical continuous quality gates for development processAndrii Soldatenko
 
Grooving with Jenkins
Grooving with JenkinsGrooving with Jenkins
Grooving with JenkinsAnton Weiss
 
GitHub Actions with Node.js
GitHub Actions with Node.jsGitHub Actions with Node.js
GitHub Actions with Node.jsStefan Stölzle
 

What's hot (20)

Jenkins Best Practices
Jenkins Best PracticesJenkins Best Practices
Jenkins Best Practices
 
Dockercon2015 bamboo
Dockercon2015 bambooDockercon2015 bamboo
Dockercon2015 bamboo
 
Gradle - From minutes to seconds: minimizing build times
Gradle - From minutes to seconds: minimizing build timesGradle - From minutes to seconds: minimizing build times
Gradle - From minutes to seconds: minimizing build times
 
JUC Europe 2015: Orchestrating Your Pipelines with Jenkins, Python and the Je...
JUC Europe 2015: Orchestrating Your Pipelines with Jenkins, Python and the Je...JUC Europe 2015: Orchestrating Your Pipelines with Jenkins, Python and the Je...
JUC Europe 2015: Orchestrating Your Pipelines with Jenkins, Python and the Je...
 
Stockholm Jenkins Area Meetup, March 2017
Stockholm Jenkins Area Meetup, March 2017Stockholm Jenkins Area Meetup, March 2017
Stockholm Jenkins Area Meetup, March 2017
 
GitHub Actions in action
GitHub Actions in actionGitHub Actions in action
GitHub Actions in action
 
CI/CD with GitHub Actions
CI/CD with GitHub ActionsCI/CD with GitHub Actions
CI/CD with GitHub Actions
 
Jfokus 2017 - The DevOps Disaster
Jfokus 2017 - The DevOps Disaster Jfokus 2017 - The DevOps Disaster
Jfokus 2017 - The DevOps Disaster
 
Code review vs pull request
Code review vs pull requestCode review vs pull request
Code review vs pull request
 
Automated android testing using jenkins ci
Automated android testing using jenkins ciAutomated android testing using jenkins ci
Automated android testing using jenkins ci
 
Container based CI/CD on GitHub Actions
Container based CI/CD on GitHub ActionsContainer based CI/CD on GitHub Actions
Container based CI/CD on GitHub Actions
 
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
 
Next-gen DevOps engineering with Docker and Kubernetes by Antons Kranga
Next-gen DevOps engineering with Docker and Kubernetes by Antons KrangaNext-gen DevOps engineering with Docker and Kubernetes by Antons Kranga
Next-gen DevOps engineering with Docker and Kubernetes by Antons Kranga
 
Practical continuous quality gates for development process
Practical continuous quality gates for development processPractical continuous quality gates for development process
Practical continuous quality gates for development process
 
From Virtual Machines to Containers
From Virtual Machines to ContainersFrom Virtual Machines to Containers
From Virtual Machines to Containers
 
Github in Action
Github in ActionGithub in Action
Github in Action
 
Grooving with Jenkins
Grooving with JenkinsGrooving with Jenkins
Grooving with Jenkins
 
GitHub Actions with Node.js
GitHub Actions with Node.jsGitHub Actions with Node.js
GitHub Actions with Node.js
 
Jenkins presentation
Jenkins presentationJenkins presentation
Jenkins presentation
 
Git best practices workshop
Git best practices workshopGit best practices workshop
Git best practices workshop
 

Viewers also liked

Jenkins plugins
Jenkins pluginsJenkins plugins
Jenkins pluginstyuki39
 
Continuous Delivery of Puppet-Based Infrastructure - PuppetConf 2014
Continuous Delivery of Puppet-Based Infrastructure - PuppetConf 2014Continuous Delivery of Puppet-Based Infrastructure - PuppetConf 2014
Continuous Delivery of Puppet-Based Infrastructure - PuppetConf 2014Puppet
 
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Puppet
 
Synchronizing parallel delivery flows in jenkins using groovy, build flow and...
Synchronizing parallel delivery flows in jenkins using groovy, build flow and...Synchronizing parallel delivery flows in jenkins using groovy, build flow and...
Synchronizing parallel delivery flows in jenkins using groovy, build flow and...Andrey Devyatkin
 
Writing a Jenkins / Hudson plugin
Writing a Jenkins / Hudson pluginWriting a Jenkins / Hudson plugin
Writing a Jenkins / Hudson pluginAnthony Dahanne
 
groovy and concurrency
groovy and concurrencygroovy and concurrency
groovy and concurrencyPaul King
 
Jenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with JenkinsJenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with JenkinsAll Things Open
 
Jenkins Scriptler in 90mins
Jenkins Scriptler in 90minsJenkins Scriptler in 90mins
Jenkins Scriptler in 90minsLarry Cai
 
Continuous Development Pipeline
Continuous Development PipelineContinuous Development Pipeline
Continuous Development PipelineIzzet Mustafaiev
 
Building an Extensible, Resumable DSL on Top of Apache Groovy
Building an Extensible, Resumable DSL on Top of Apache GroovyBuilding an Extensible, Resumable DSL on Top of Apache Groovy
Building an Extensible, Resumable DSL on Top of Apache Groovyjgcloudbees
 
Jenkins days workshop pipelines - Eric Long
Jenkins days workshop  pipelines - Eric LongJenkins days workshop  pipelines - Eric Long
Jenkins days workshop pipelines - Eric Longericlongtx
 
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Andrew Bayer
 

Viewers also liked (14)

Jenkins plugins
Jenkins pluginsJenkins plugins
Jenkins plugins
 
Jenkins Job DSL plugin
Jenkins Job DSL plugin Jenkins Job DSL plugin
Jenkins Job DSL plugin
 
Continuous Delivery of Puppet-Based Infrastructure - PuppetConf 2014
Continuous Delivery of Puppet-Based Infrastructure - PuppetConf 2014Continuous Delivery of Puppet-Based Infrastructure - PuppetConf 2014
Continuous Delivery of Puppet-Based Infrastructure - PuppetConf 2014
 
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
 
Synchronizing parallel delivery flows in jenkins using groovy, build flow and...
Synchronizing parallel delivery flows in jenkins using groovy, build flow and...Synchronizing parallel delivery flows in jenkins using groovy, build flow and...
Synchronizing parallel delivery flows in jenkins using groovy, build flow and...
 
Writing a Jenkins / Hudson plugin
Writing a Jenkins / Hudson pluginWriting a Jenkins / Hudson plugin
Writing a Jenkins / Hudson plugin
 
groovy and concurrency
groovy and concurrencygroovy and concurrency
groovy and concurrency
 
Jenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with JenkinsJenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with Jenkins
 
Jenkins Scriptler in 90mins
Jenkins Scriptler in 90minsJenkins Scriptler in 90mins
Jenkins Scriptler in 90mins
 
Groovy Maven Builds
Groovy Maven BuildsGroovy Maven Builds
Groovy Maven Builds
 
Continuous Development Pipeline
Continuous Development PipelineContinuous Development Pipeline
Continuous Development Pipeline
 
Building an Extensible, Resumable DSL on Top of Apache Groovy
Building an Extensible, Resumable DSL on Top of Apache GroovyBuilding an Extensible, Resumable DSL on Top of Apache Groovy
Building an Extensible, Resumable DSL on Top of Apache Groovy
 
Jenkins days workshop pipelines - Eric Long
Jenkins days workshop  pipelines - Eric LongJenkins days workshop  pipelines - Eric Long
Jenkins days workshop pipelines - Eric Long
 
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
 

Similar to Super Charged Configuration As Code

Configuration as Code: The Job DSL Plugin
Configuration as Code: The Job DSL PluginConfiguration as Code: The Job DSL Plugin
Configuration as Code: The Job DSL PluginDaniel Spilker
 
Jenkins User Conference 2014
Jenkins User Conference 2014Jenkins User Conference 2014
Jenkins User Conference 2014Dan Cundiff
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins PipelinesSteffen Gebert
 
Pipeline as code - new feature in Jenkins 2
Pipeline as code - new feature in Jenkins 2Pipeline as code - new feature in Jenkins 2
Pipeline as code - new feature in Jenkins 2Michal Ziarnik
 
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los AngelesJenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los AngelesAndy Pemberton
 
Jenkins vs. AWS CodePipeline
Jenkins vs. AWS CodePipelineJenkins vs. AWS CodePipeline
Jenkins vs. AWS CodePipelineSteffen Gebert
 
JUC Europe 2015: From Virtual Machines to Containers: Achieving Continuous In...
JUC Europe 2015: From Virtual Machines to Containers: Achieving Continuous In...JUC Europe 2015: From Virtual Machines to Containers: Achieving Continuous In...
JUC Europe 2015: From Virtual Machines to Containers: Achieving Continuous In...CloudBees
 
413450-rc218-cdw-jenkins-workflow
413450-rc218-cdw-jenkins-workflow413450-rc218-cdw-jenkins-workflow
413450-rc218-cdw-jenkins-workflowAndy Pemberton
 
Jenkins as a Service - Code all the way down
Jenkins as a Service - Code all the way downJenkins as a Service - Code all the way down
Jenkins as a Service - Code all the way downSteve Mactaggart
 
Testing Salesforce at Cloud Scale
Testing Salesforce at Cloud ScaleTesting Salesforce at Cloud Scale
Testing Salesforce at Cloud Scalegwestr
 
JUC Europe 2015: Hey! What Did We Just Release?
JUC Europe 2015: Hey! What Did We Just Release?JUC Europe 2015: Hey! What Did We Just Release?
JUC Europe 2015: Hey! What Did We Just Release?CloudBees
 
Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015Kurt Madel
 
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)Steffen Gebert
 
DEVOPS LIVE 2018 JaC
DEVOPS LIVE 2018 JaCDEVOPS LIVE 2018 JaC
DEVOPS LIVE 2018 JaCBrian Mericle
 

Similar to Super Charged Configuration As Code (20)

Configuration as Code: The Job DSL Plugin
Configuration as Code: The Job DSL PluginConfiguration as Code: The Job DSL Plugin
Configuration as Code: The Job DSL Plugin
 
Jenkins User Conference 2014
Jenkins User Conference 2014Jenkins User Conference 2014
Jenkins User Conference 2014
 
Juc boston2014.pptx
Juc boston2014.pptxJuc boston2014.pptx
Juc boston2014.pptx
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
 
Pipeline as code - new feature in Jenkins 2
Pipeline as code - new feature in Jenkins 2Pipeline as code - new feature in Jenkins 2
Pipeline as code - new feature in Jenkins 2
 
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los AngelesJenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
 
Jenkins vs. AWS CodePipeline
Jenkins vs. AWS CodePipelineJenkins vs. AWS CodePipeline
Jenkins vs. AWS CodePipeline
 
JUC Europe 2015: From Virtual Machines to Containers: Achieving Continuous In...
JUC Europe 2015: From Virtual Machines to Containers: Achieving Continuous In...JUC Europe 2015: From Virtual Machines to Containers: Achieving Continuous In...
JUC Europe 2015: From Virtual Machines to Containers: Achieving Continuous In...
 
413450-rc218-cdw-jenkins-workflow
413450-rc218-cdw-jenkins-workflow413450-rc218-cdw-jenkins-workflow
413450-rc218-cdw-jenkins-workflow
 
Jenkins as a Service - Code all the way down
Jenkins as a Service - Code all the way downJenkins as a Service - Code all the way down
Jenkins as a Service - Code all the way down
 
Testing Salesforce at Cloud Scale
Testing Salesforce at Cloud ScaleTesting Salesforce at Cloud Scale
Testing Salesforce at Cloud Scale
 
Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
 
Gluecon 2018 JaC
Gluecon 2018 JaCGluecon 2018 JaC
Gluecon 2018 JaC
 
JUC Europe 2015: Hey! What Did We Just Release?
JUC Europe 2015: Hey! What Did We Just Release?JUC Europe 2015: Hey! What Did We Just Release?
JUC Europe 2015: Hey! What Did We Just Release?
 
Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015Atlanta Jenkins Area Meetup October 22nd 2015
Atlanta Jenkins Area Meetup October 22nd 2015
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
 
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
 
DEVOPS LIVE 2018 JaC
DEVOPS LIVE 2018 JaCDEVOPS LIVE 2018 JaC
DEVOPS LIVE 2018 JaC
 
Jenkins State of union 2013
Jenkins State of union 2013Jenkins State of union 2013
Jenkins State of union 2013
 
Jenkins-CI
Jenkins-CIJenkins-CI
Jenkins-CI
 

Recently uploaded

Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineeringssuserb3a23b
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 

Recently uploaded (20)

Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineering
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 

Super Charged Configuration As Code

  • 1. Jenkins User Conference San Francisco #jenkinsconf Supercharged Configuration As Code Bulk Updates with Job DSL and System Groovy Alan Beale Chicago Trading Company ! ! October 23, 2014 #jenkinsconf
  • 2. Jenkins User Conference San Francisco #jenkinsconf Who Am I • Alan Beale Build Engineer @ Chicago Trading Company The statements, remarks and conclusions of this presentation are my own and do not represent the views of my employer, CTC Trading Group, L.L.C. (“CTC”).
  • 3. Jenkins User Conference San Francisco #jenkinsconf Have you ever found a change that you need to apply to 100 jobs?
  • 4. Jenkins User Conference San Francisco #jenkinsconf • Job DSL is a plugin that allows users to create job configurations with a groovy domain specific language • System groovy scripts are groovy scripts that have access the the Jenkins.instance calling various parts of the Jenkins API
  • 5. Jenkins User Conference San Francisco #jenkinsconf Observations about build jobs • Jobs Change over Time • Most jobs are like other jobs
  • 6. Jenkins User Conference San Francisco #jenkinsconf Jobs Change Over Time • Correctness Changes • Bug Fixes • Complexity Increase
  • 7. Jenkins User Conference San Francisco #jenkinsconf Most Jobs are Similar • Small number of themes with structured variation
  • 8. Jenkins User Conference San Francisco #jenkinsconf Example of Job Themes • Continuous Integration Jobs • Gerrit Verification Jobs • Release Jobs • Privileged SCM Task Automation
  • 9. Jenkins User Conference San Francisco #jenkinsconf How do these observations help? • Job DSL enables us to using coding techniques to create job configurations • System groovy scripts enable use to automate repeated calls to jobs
  • 10. Jenkins User Conference San Francisco #jenkinsconf Player Piano • Our metaphor for bulk job regeneration
  • 11. Jenkins User Conference San Francisco #jenkinsconf The Piano Roll • Controls the sound of the piano • Orchestrates the automation of job recreation
  • 12. Jenkins User Conference San Francisco #jenkinsconf Job DSL for gradle build job { name "git-gradle-simple-build" scm { git('/Users/alanbeale/sandbox/samples/java/basic', '*/master' ) } steps { gradle ( "build", null, true ) } }
  • 13. Jenkins User Conference San Francisco #jenkinsconf Evolution Example job { name "git-gradle-build-with-worspace-option" scm { git('/Users/alanbeale/sandbox/samples/java/basic', ‘*/master') } steps { gradle ( "build", null, true ){ node -> //hudson.plugins.gradle.Gradle node/useWorkspaceAsHome(true) } } }
  • 14. Jenkins User Conference San Francisco #jenkinsconf Add Gerrit Trigger • https://github.com/bealeaj1214/jenkins-juc- job-dsl-bulk-regeneration/blob/master/src/ examples/jobdsl/scm-gradle-gerrit-build.jobDSL
  • 15. Jenkins User Conference San Francisco #jenkinsconf Repeated elements • Job Name • Git URL • Gerrit Trigger Project
  • 16. Jenkins User Conference San Francisco #jenkinsconf Towards Job Factory • Factor out common operations • Parameterize calling Job DSL
  • 17. Jenkins User Conference San Francisco #jenkinsconf Create Utility class • jobdsl.JobUtilities methods • setupGradleGerritJobName() • setupGerritScm() • setupGerritTrigger() • setupGradleBuild()
  • 18. Jenkins User Conference San Francisco #jenkinsconf JobUtilities.groovy • https://github.com/bealeaj1214/jenkins-juc- job-dsl-bulk-regeneration/blob/master/src/ main/groovy/jobdsl/JobUtilities.groovy
  • 19. Jenkins User Conference San Francisco #jenkinsconf generator job DSL • https://github.com/bealeaj1214/jenkins-juc- job-dsl-bulk-regeneration/blob/master/src/ generator/jobdsl/ seed4GradleGerritJobs.jobDSL
  • 20. Jenkins User Conference San Francisco #jenkinsconf Part 2 : System Groovy
  • 21. Jenkins User Conference San Francisco #jenkinsconf Regeneration script import jenkins.model.* ! import hudson.model.* ! def jenkins = jenkins.model.Jenkins.instance def jobGeneratorName='gradle-gerrit-job-generator' def jobGenerator = jenkins.getItem(jobGeneratorName) def projectParamName ='PROJECT_NAME' def projectParamValue=‘sample/java/library' ! if(jobGenerator){ boolean buildQueued = jobGenerator.scheduleBuild( 5, new Cause.UserIdCause(), new ParametersAction( new StringParameterValue(projectParamName, projectParamValue) ) ) }
  • 22. Jenkins User Conference San Francisco #jenkinsconf Regenerate from existing job name import jenkins.model.* ! import hudson.model.* ! def jenkins = jenkins.model.Jenkins.instance def jobGeneratorName='gradle-gerrit-job-generator' def jobGenerator = jenkins.getItem(jobGeneratorName) def projectParamName ='PROJECT_NAME' def jobs = jenkins.getItems() ! def gerritJobs = jobs.findAll { job -> job.name.endsWith('gradle-gerrit') } ! def projectNames =gerritJobs.collect { item -> item.triggers.values().find { it.class.simpleName =='GerritTrigger' }. gerritProjects[0].pattern } ! if(jobGenerator){ projectNames.each { projectName -> boolean buildQueued = jobGenerator.scheduleBuild( 5, new Cause.UserIdCause(), new ParametersAction( new StringParameterValue( projectParamName,projectName) ) ) } }
  • 23. Jenkins User Conference San Francisco #jenkinsconf Summary • Job DSL enables precise control • Define parameterized Job Generator (the piano)
  • 24. Jenkins User Conference San Francisco #jenkinsconf Summary • System Groovy Jobs • automates calling job generator in bulk (piano roll)
  • 25. Jenkins User Conference San Francisco #jenkinsconf Thank You To Our Sponsors Platinum Gold Silver Corporate
  • 26. Jenkins User Conference San Francisco #jenkinsconf Thank You • Source Code at https://github.com/bealeaj1214/ jenkins-juc-job-dsl-bulk-regeneration