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

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 

Recently uploaded (20)

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 

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