Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Jenkins User Conference Europe #jenkinsconf
Configuration As Code
The Job DSL Plugin
Daniel Spilker
CoreMedia
www.coremedi...
Jenkins User Conference Europe #jenkinsconf
Current Situation
• No single job that builds everything
• Each branch needs i...
Jenkins User Conference Europe #jenkinsconf
Problem
• Lots of copy&paste
• Editing in HTML text areas
• Settings hidden be...
Jenkins User Conference Europe #jenkinsconf
Configuration As Code
• Create new pipelines quickly
• Refactor jobs
• Trace c...
Jenkins User Conference Europe #jenkinsconf
There Is A Plugin For That
• Template Project Plugin
• Job Generator Plugin
• ...
Jenkins User Conference Europe #jenkinsconf
Job DSL Language
job {
name('job-dsl-plugin-folders')
scm {
github('daspilker/...
Jenkins User Conference Europe #jenkinsconf
Job DSL Language
job {
name('job-dsl-plugin-folders')
scm {
github('daspilker/...
Jenkins User Conference Europe #jenkinsconf
Job DSL Language
job {
name('job-dsl-plugin-folders')
scm {
github('daspilker/...
Jenkins User Conference Europe #jenkinsconf
Job DSL Language
job {
name('job-dsl-plugin-folders')
scm {
github('daspilker/...
Jenkins User Conference Europe #jenkinsconf
Job DSL Language
job {
name('job-dsl-plugin-folders')
scm {
github('daspilker/...
Jenkins User Conference Europe #jenkinsconf
Job DSL Language
job {
name('job-dsl-plugin-folders')
scm {
github('daspilker/...
Jenkins User Conference Europe #jenkinsconf
Job DSL Plugin
• Install Job DSL Plugin
• Create free-style project
• Add “Sou...
Jenkins User Conference Europe #jenkinsconf
Job DSL Plugin
• Install Job DSL Plugin
• Create free-style project
• Add “Sou...
Jenkins User Conference Europe #jenkinsconf
Job DSL Plugin
• Install Job DSL Plugin
• Create free-style project
• Add “Sou...
Jenkins User Conference Europe #jenkinsconf
Job DSL Plugin
• Install Job DSL Plugin
• Create free-style project
• Add “Sou...
Jenkins User Conference Europe #jenkinsconf
Job DSL Plugin
• Install Job DSL Plugin
• Create free-style project
• Add “Sou...
Jenkins User Conference Europe #jenkinsconf
Job DSL Plugin
• Install Job DSL Plugin
• Create free-style project
• Add “Sou...
Jenkins User Conference Europe #jenkinsconf
Job DSL Plugin
• Install Job DSL Plugin
• Create free-style project
• Add “Sou...
Jenkins User Conference Europe #jenkinsconf
Batteries Included
EnvInject
Groovy
Copy Artifact
Git
Subversion
Folders
Extra...
Jenkins User Conference Europe #jenkinsconf
Extending The DSL
Jenkins User Conference Europe #jenkinsconf
Extending The DSL
Jenkins User Conference Europe #jenkinsconf
Extending The DSL
job {
...
configure { project ->
project / buildWrappers << ...
Jenkins User Conference Europe #jenkinsconf
Everything is Groovy
@Grab(…)
…
gitHub.user('daspilker').repos.each { repo ->
...
Jenkins User Conference Europe #jenkinsconf
Further Information
• Documentation
https://github.com/jenkinsci/job-dsl-plugi...
Jenkins User Conference Europe #jenkinsconf
Corporate
Community
Thank You To Our Sponsors
Platinum Gold
Silver
Jenkins User Conference Europe #jenkinsconf
Thank You
Daniel Spilker
daniel.spilker@coremedia.com
@daspilker
We‘re hiring
...
Upcoming SlideShare
Loading in …5
×

Configuration As Code: The Job DSL Plugin

3,620 views

Published on

An introduction the Job DSL plugin for the Jenkins continuous integration server. Learn how to treat job and view configuration as code, how to store the configuration in SCM and how to apply code reuse and refactoring. Learn how to extend the Job DSL for your favorite plugins.

Published in: Software, Technology, Business
  • Follow the link, new dating source: ❶❶❶ http://bit.ly/2Qu6Caa ❶❶❶
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating for everyone is here: ❶❶❶ http://bit.ly/2Qu6Caa ❶❶❶
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Configuration As Code: The Job DSL Plugin

  1. 1. Jenkins User Conference Europe #jenkinsconf Configuration As Code The Job DSL Plugin Daniel Spilker CoreMedia www.coremedia.com June 25, 2014 #jenkinsconf
  2. 2. Jenkins User Conference Europe #jenkinsconf Current Situation • No single job that builds everything • Each branch needs its own pipeline • Every team has their own jobs
  3. 3. Jenkins User Conference Europe #jenkinsconf Problem • Lots of copy&paste • Editing in HTML text areas • Settings hidden behind Advanced button • Working with the UI can be slow
  4. 4. Jenkins User Conference Europe #jenkinsconf Configuration As Code • Create new pipelines quickly • Refactor jobs • Trace changes • Work with your favorite tool set
  5. 5. Jenkins User Conference Europe #jenkinsconf There Is A Plugin For That • Template Project Plugin • Job Generator Plugin • Literate Plugin • JobConfigHistory Plugin • … • Job DSL Plugin Open Icon Library / CC BY 3.0
  6. 6. Jenkins User Conference Europe #jenkinsconf Job DSL Language job { name('job-dsl-plugin-folders') scm { github('daspilker/job-dsl-plugin', 'folders') } triggers { githubPush() } steps { gradle('clean build') } publishers { archiveArtifacts('**/job-dsl.hpi') } }
  7. 7. Jenkins User Conference Europe #jenkinsconf Job DSL Language job { name('job-dsl-plugin-folders') scm { github('daspilker/job-dsl-plugin', 'folders') } triggers { githubPush() } steps { gradle('clean build') } publishers { archiveArtifacts('**/job-dsl.hpi') } }
  8. 8. Jenkins User Conference Europe #jenkinsconf Job DSL Language job { name('job-dsl-plugin-folders') scm { github('daspilker/job-dsl-plugin', 'folders') } triggers { githubPush() } steps { gradle('clean build') } publishers { archiveArtifacts('**/job-dsl.hpi') } }
  9. 9. Jenkins User Conference Europe #jenkinsconf Job DSL Language job { name('job-dsl-plugin-folders') scm { github('daspilker/job-dsl-plugin', 'folders') } triggers { githubPush() } steps { gradle('clean build') } publishers { archiveArtifacts('**/job-dsl.hpi') } }
  10. 10. Jenkins User Conference Europe #jenkinsconf Job DSL Language job { name('job-dsl-plugin-folders') scm { github('daspilker/job-dsl-plugin', 'folders') } triggers { githubPush() } steps { gradle('clean build') } publishers { archiveArtifacts('**/job-dsl.hpi') } }
  11. 11. Jenkins User Conference Europe #jenkinsconf Job DSL Language job { name('job-dsl-plugin-folders') scm { github('daspilker/job-dsl-plugin', 'folders') } triggers { githubPush() } steps { gradle('clean build') } publishers { archiveArtifacts('**/job-dsl.hpi') } }
  12. 12. Jenkins User Conference Europe #jenkinsconf Job DSL Plugin • Install Job DSL Plugin • Create free-style project • Add “Source Code Management” • Add “Process Job DSL” build step • Configure scripts • Run job
  13. 13. Jenkins User Conference Europe #jenkinsconf Job DSL Plugin • Install Job DSL Plugin • Create free-style project • Add “Source Code Management” • Add “Process Job DSL” build step • Configure scripts • Run job
  14. 14. Jenkins User Conference Europe #jenkinsconf Job DSL Plugin • Install Job DSL Plugin • Create free-style project • Add “Source Code Management” • Add “Process Job DSL” build step • Configure scripts • Run job
  15. 15. Jenkins User Conference Europe #jenkinsconf Job DSL Plugin • Install Job DSL Plugin • Create free-style project • Add “Source Code Management” • Add “Process Job DSL” build step • Configure scripts • Run job
  16. 16. Jenkins User Conference Europe #jenkinsconf Job DSL Plugin • Install Job DSL Plugin • Create free-style project • Add “Source Code Management” • Add “Process Job DSL” build step • Configure scripts • Run job
  17. 17. Jenkins User Conference Europe #jenkinsconf Job DSL Plugin • Install Job DSL Plugin • Create free-style project • Add “Source Code Management” • Add “Process Job DSL” build step • Configure scripts • Run job
  18. 18. Jenkins User Conference Europe #jenkinsconf Job DSL Plugin • Install Job DSL Plugin • Create free-style project • Add “Source Code Management” • Add “Process Job DSL” build step • Configure scripts • Run job
  19. 19. Jenkins User Conference Europe #jenkinsconf Batteries Included EnvInject Groovy Copy Artifact Git Subversion Folders Extra Columns StashNotifier Maven Deployment Linker Gradle Build Pipeline Workspace Cleanup GitHub Pull Request Builder GitHub Multiple SCMs JaCoCoRelease Build Flow Robot Framework Tool Environment Conditional BuildStep Throttle Concurrent Builds Associated Files JSHint Checkstyle Emma Xvnc Prerequisite Build Step AnsiColor Timestamper Text-Finder Job DSL Perforce Ant Maven Project
  20. 20. Jenkins User Conference Europe #jenkinsconf Extending The DSL
  21. 21. Jenkins User Conference Europe #jenkinsconf Extending The DSL
  22. 22. Jenkins User Conference Europe #jenkinsconf Extending The DSL job { ... configure { project -> project / buildWrappers << EnvInjectPasswordWrapper { injectGlobalPasswords(true) } } }
  23. 23. Jenkins User Conference Europe #jenkinsconf Everything is Groovy @Grab(…) … gitHub.user('daspilker').repos.each { repo -> repo.branches.each { branch -> job { name("${repo.name}-${branch.name}") scm { github(repo.name, branch.name) } … } } }
  24. 24. Jenkins User Conference Europe #jenkinsconf Further Information • Documentation https://github.com/jenkinsci/job-dsl-plugin/wiki • Examples https://github.com/sheehan/job-dsl-gradle-example • Playground http://job-dsl.herokuapp.com/ • Mailing List https://groups.google.com/forum/?fromgroups#!forum/job-dsl-plugin
  25. 25. Jenkins User Conference Europe #jenkinsconf Corporate Community Thank You To Our Sponsors Platinum Gold Silver
  26. 26. Jenkins User Conference Europe #jenkinsconf Thank You Daniel Spilker daniel.spilker@coremedia.com @daspilker We‘re hiring www.coremedia.com @CoreMediaMinds

×