SlideShare a Scribd company logo
Larry cai <larry.caiyu@gmail.com>
Agenda
 Introduction
 Exercise 1: Run the example to know the power
 Exercise 2: Hello World – first DSL
 Exercise 3: One complete JobDSL
 Exercise 4: JenkinsView and Loop
 Exercise 5: Configure Block to extend DSL
 Reference
2 08/12/15
Environment Preparation (docker)
 Boot2docker Installer (127M)
 Contains latest docker already, fast
 Container persistence via disk automount on /var/lib/docker
 $ docker -v
 User/Passwd: docker/tcuser (192.168.59.103)
 Download Jenkins JobDSL docker images
 $ docker pull larrycai/jenkins-jobdsl
 Notepad++ & MobaXterm are recommended
3 08/12/15
http://boot2docker.io/
Introduction
 Jenkins is a de-facto CI standard used for lots of products
 Easy to start, configure and extending (300+ plugins)
 Configure jobs in UI mostly
 Weak parts:
 Update git repo for many jobs
 Create dozens of jobs in fly for new project
 Monitor the changes
4 08/12/15
Learn new way to configure jenkins Jobs
Exercise 1: Hello World
 Run first app inside docker environment
$ cd /c/<Users>/codingwithme/jobdsl # create in advance
$ docker run -it –v $PWD:/opt/jenkins/data/jobs/jobdsl/workspace -p
8080:8080 larrycai/jenkins-jobdsl
 Browse: http://192.168.59.103:8080
Clean jenkins UI with one Job “HelloWorld”
 Exercise :
1. Execute job “HelloWorld”, and check result
2. See configuration
3. Run it again
4. Delete job “Compile-DSL-Tutorial-0” and Update job “Package-DSL-
Tutorial-0” and Run it again
5 08/12/15
JobDSL is Groovy based
 DSL : Domain Specific Language, easy to read and
understand
 JobDSL is jenkins plugin, https://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin
 Groovy based
6 08/12/15
• Groovy is a multi-faceted
language for the Java
platform
• Groovy used in jenkins to
access internal data
JobDSL & Idempotent
 JobDSL helps to simplify the maintenance of jenkins jobs
 An idempotent operation is one that can be applied
multiple times without changing the result beyond the
initial application
 Keep the environment stable, reliable
 No matter the job is changed by someone, if the jobDSL
script is run, it will reach to the desired status
7 08/12/15
Exercise 2:Hello World
 Configure “HelloWorld” job
 Replace script like below
freeStyleJob("Hello2") {
steps {
shell('echo "Hello Larry"')
}
}
 Select option “Action for removed jobs” to “Delete”
and option “Action for removed views” to “Delete”,
Run it again
8 08/12/15
Jenkins Job mapping to JobDSL
9 08/12/15
 Job Type (freeStyleJob)
 Build Parameters (parameters)
 SCM (scm)
 BuildTriggers (triggers)
 Steps (steps)
 Post Build Actions (publishers)
https://github.com/jenkinsci/job-dsl-plugin/wiki/Job-reference
Exercise 3: Complete JobDSL example
 Follow the existing Jenkins job “Sample” and convert it into
JobDSL in “jobdsl”
 Cover Scm/trigger/shell/archive
 Steps:
 New job “jobdsl” (freestyle)
 New build step – Process Job DSLs
 Choose “Look on Filesystem”
 complete.groovy
 In file, use freeStyleJob(“Hello3”)
 Edit it in Windows env. (codingwith/jobdsl) # mapped into docker
 Compare the result
10 08/12/15
Reference: https://github.com/jenkinsci/job-dsl-plugin/wiki/Job-reference
Jenkins View & Groovy DSL
 JenkinsView is simple as jobs
 Name/filter/column .
 Learn some groovy to handle
common tasks
 Loop
 Read & Parse external config files
11 08/12/15
Exercise 4: List View and Loop
 Create different ListView and generate multi jobs based
on the config file
 Based on HelloWorld Example for jobs
 Json file: HelloWorld/workspace/views.json
 Steps
 Create new view.groovy
 Run inside job jobdsl
12 08/12/15
Configure block
 Not every jenkins Plugin are supported in JobDSL (may
changes in the future)
 Raise issues to get support
 Configure blocks are used inside the Job DSL to give
direct access to underlying XML of the Jenkins config.xml
13 08/12/15
https://github.com/jenkinsci/job-dsl-plugin/wiki/The-Configure-Block
Exercise 5: Configure Block for testNG
 Change the Sample job to export testNG result, which is
not support by jobDSL yet.
 Steps:
 Configure Sample job to publish testNG result in post-build
 Check generate config.xml
http://localhost:8080/view/CodingWithMe/job/Sample/config.xml
 Write testng.groovy based on complete.groovy
 Generate job Hello5
 Compare result
14 08/12/15
Summary
 JobDSL is the powerful to simplify the maintenance of
your jenkins jobs and keep it in professional way
 Put jobDSL scripts in git repo
 What we learn
 Execute JobDSL in jenkins jobs
 Inside script & script file
 Create job/View in jobDSL
 Simple Groovy knowledge to handle loop/read external data
 Configure Block in jobDSL to handle not direct supported
plugins
15 08/12/15
Reference
 jobDSL slides
 http://www.slideshare.net/daspilker/configuration-as-code-the-job-dsl-plugin
 JobDSL ref
 https://github.com/jenkinsci/job-dsl-plugin/wiki/View-Reference
 https://github.com/jenkinsci/job-dsl-plugin/wiki/Job-reference
 https://github.com/jenkinsci/job-dsl-plugin/wiki/The-Configure-Block
 Groovy Json
 http://www.groovy-lang.org/json.html
 Exercise Gist
 https://gist.github.com/larrycai/aeb9a3b037dcb17df9b2
16 08/12/15
CodingWithMe
 "CodingWithMe - Learning by Coding" is a coding
workshop, it aims to learn one technology in 90
minutes by practice
 Features:
 4-5 well tuned hands on exercises in 90 minutes
 First exercise shall be started in 20 minutes
 It well follows Bob Pike’s 90/20/8 rules (happen to
know)
 It is recommended arranged for several parallel
sessions if it is organized in the company.
17 08/12/15
http://www.larrycaiyu.com/blog/2014/03/18/codingwithme_introduction/

More Related Content

What's hot

Володимир Дубенко "Node.js for desktop development (based on Electron library)"
Володимир Дубенко "Node.js for desktop development (based on Electron library)"Володимир Дубенко "Node.js for desktop development (based on Electron library)"
Володимир Дубенко "Node.js for desktop development (based on Electron library)"
Fwdays
 
Zero to Continuous Delivery on Google Cloud
Zero to Continuous Delivery on Google CloudZero to Continuous Delivery on Google Cloud
Zero to Continuous Delivery on Google Cloud
James Heggs
 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Docker
toffermann
 
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
jgcloudbees
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
HubSpot
 
GlassFish Embedded API
GlassFish Embedded APIGlassFish Embedded API
GlassFish Embedded API
Eduardo Pelegri-Llopart
 
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
ZeroTurnaround
 
Containerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and JavaContainerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and Java
Jadson Santos
 
JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具
謝 宗穎
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
Steffen Gebert
 
Continuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and JenkinsContinuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and Jenkins
Camilo Ribeiro
 
Jenkins 101: Getting Started
Jenkins 101: Getting StartedJenkins 101: Getting Started
Jenkins 101: Getting Started
R Geoffrey Avery
 
Deploying an application with Chef and Docker
Deploying an application with Chef and DockerDeploying an application with Chef and Docker
Deploying an application with Chef and Docker
Daniel Ku
 
Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
Steffen Gebert
 
JavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as codeJavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as code
Bert Jan Schrijver
 
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems IntegrationJenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Oleg Nenashev
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutes
Larry Cai
 
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationIBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
Development Seed
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chef
Mukta Aphale
 
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
Michal Ziarnik
 

What's hot (20)

Володимир Дубенко "Node.js for desktop development (based on Electron library)"
Володимир Дубенко "Node.js for desktop development (based on Electron library)"Володимир Дубенко "Node.js for desktop development (based on Electron library)"
Володимир Дубенко "Node.js for desktop development (based on Electron library)"
 
Zero to Continuous Delivery on Google Cloud
Zero to Continuous Delivery on Google CloudZero to Continuous Delivery on Google Cloud
Zero to Continuous Delivery on Google Cloud
 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Docker
 
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
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
GlassFish Embedded API
GlassFish Embedded APIGlassFish Embedded API
GlassFish Embedded API
 
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
[Image Results] Java Build Tools: Part 2 - A Decision Maker's Guide Compariso...
 
Containerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and JavaContainerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and Java
 
JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具JCConf 2015 workshop 動手玩 Java 專案建置工具
JCConf 2015 workshop 動手玩 Java 專案建置工具
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
 
Continuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and JenkinsContinuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and Jenkins
 
Jenkins 101: Getting Started
Jenkins 101: Getting StartedJenkins 101: Getting Started
Jenkins 101: Getting Started
 
Deploying an application with Chef and Docker
Deploying an application with Chef and DockerDeploying an application with Chef and Docker
Deploying an application with Chef and Docker
 
Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
 
JavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as codeJavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as code
 
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems IntegrationJenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutes
 
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationIBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chef
 
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
 

Viewers also liked

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
Daniel Spilker
 
Configuration As Code - Adoption of the Job DSL Plugin at Netflix
Configuration As Code - Adoption of the Job DSL Plugin at NetflixConfiguration As Code - Adoption of the Job DSL Plugin at Netflix
Configuration As Code - Adoption of the Job DSL Plugin at Netflix
Justin Ryan
 
8 lessons learned from becoming agile
8 lessons learned from becoming agile8 lessons learned from becoming agile
8 lessons learned from becoming agile
Marko Taipale
 
OpenStack Introduction Ecosystem
OpenStack Introduction EcosystemOpenStack Introduction Ecosystem
OpenStack Introduction Ecosystem
NUTC, imac
 
Large Scale Development with Git and Gerrit - EclipseCon Europe 2012
Large Scale Development with Git and Gerrit - EclipseCon Europe 2012Large Scale Development with Git and Gerrit - EclipseCon Europe 2012
Large Scale Development with Git and Gerrit - EclipseCon Europe 2012
msohn
 
Jenkins Best Practices Meetup Slides
Jenkins Best Practices Meetup SlidesJenkins Best Practices Meetup Slides
Jenkins Best Practices Meetup Slides
Gergely Brautigam
 
Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14
Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14
Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14
msohn
 
Group Development
Group DevelopmentGroup Development
Group Development
Roman Keller
 
Write book in markdown
Write book in markdownWrite book in markdown
Write book in markdown
Larry Cai
 
So, you want to be a plugin developer?
So, you want to be a plugin developer?So, you want to be a plugin developer?
So, you want to be a plugin developer?
ylefebvre
 
Intégration continue
Intégration continueIntégration continue
Intégration continueKlee Group
 
Introduction to ci with jenkins
Introduction to ci with jenkinsIntroduction to ci with jenkins
Introduction to ci with jenkins
Eric Hogue
 
Lcu14 Lightning Talk- NGINX
Lcu14 Lightning Talk- NGINXLcu14 Lightning Talk- NGINX
Lcu14 Lightning Talk- NGINX
Linaro
 
Introduction to OpenStack : Barcamp Bangkhen 2016
Introduction to OpenStack : Barcamp Bangkhen 2016Introduction to OpenStack : Barcamp Bangkhen 2016
Introduction to OpenStack : Barcamp Bangkhen 2016
Opsta
 
Learn nginx in 90mins
Learn nginx in 90minsLearn nginx in 90mins
Learn nginx in 90mins
Larry Cai
 
Job DSL Plugin for Jenkins
Job DSL Plugin for JenkinsJob DSL Plugin for Jenkins
Job DSL Plugin for Jenkins
Niels Bech Nielsen
 
Askep kelompok cempaka
Askep kelompok cempakaAskep kelompok cempaka
Askep kelompok cempaka
Etika Nurasih
 
The top 5 things planners need to know about self-driving vehicles
The top 5 things planners need to know about self-driving vehiclesThe top 5 things planners need to know about self-driving vehicles
The top 5 things planners need to know about self-driving vehicles
Chris Hedden
 
Dr Chris Stout Getting Better at Private Practice
Dr Chris Stout Getting Better at Private PracticeDr Chris Stout Getting Better at Private Practice
Dr Chris Stout Getting Better at Private Practice
Dr. Chris Stout
 
綻放的
綻放的綻放的
綻放的unotour
 

Viewers also liked (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
 
Configuration As Code - Adoption of the Job DSL Plugin at Netflix
Configuration As Code - Adoption of the Job DSL Plugin at NetflixConfiguration As Code - Adoption of the Job DSL Plugin at Netflix
Configuration As Code - Adoption of the Job DSL Plugin at Netflix
 
8 lessons learned from becoming agile
8 lessons learned from becoming agile8 lessons learned from becoming agile
8 lessons learned from becoming agile
 
OpenStack Introduction Ecosystem
OpenStack Introduction EcosystemOpenStack Introduction Ecosystem
OpenStack Introduction Ecosystem
 
Large Scale Development with Git and Gerrit - EclipseCon Europe 2012
Large Scale Development with Git and Gerrit - EclipseCon Europe 2012Large Scale Development with Git and Gerrit - EclipseCon Europe 2012
Large Scale Development with Git and Gerrit - EclipseCon Europe 2012
 
Jenkins Best Practices Meetup Slides
Jenkins Best Practices Meetup SlidesJenkins Best Practices Meetup Slides
Jenkins Best Practices Meetup Slides
 
Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14
Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14
Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14
 
Group Development
Group DevelopmentGroup Development
Group Development
 
Write book in markdown
Write book in markdownWrite book in markdown
Write book in markdown
 
So, you want to be a plugin developer?
So, you want to be a plugin developer?So, you want to be a plugin developer?
So, you want to be a plugin developer?
 
Intégration continue
Intégration continueIntégration continue
Intégration continue
 
Introduction to ci with jenkins
Introduction to ci with jenkinsIntroduction to ci with jenkins
Introduction to ci with jenkins
 
Lcu14 Lightning Talk- NGINX
Lcu14 Lightning Talk- NGINXLcu14 Lightning Talk- NGINX
Lcu14 Lightning Talk- NGINX
 
Introduction to OpenStack : Barcamp Bangkhen 2016
Introduction to OpenStack : Barcamp Bangkhen 2016Introduction to OpenStack : Barcamp Bangkhen 2016
Introduction to OpenStack : Barcamp Bangkhen 2016
 
Learn nginx in 90mins
Learn nginx in 90minsLearn nginx in 90mins
Learn nginx in 90mins
 
Job DSL Plugin for Jenkins
Job DSL Plugin for JenkinsJob DSL Plugin for Jenkins
Job DSL Plugin for Jenkins
 
Askep kelompok cempaka
Askep kelompok cempakaAskep kelompok cempaka
Askep kelompok cempaka
 
The top 5 things planners need to know about self-driving vehicles
The top 5 things planners need to know about self-driving vehiclesThe top 5 things planners need to know about self-driving vehicles
The top 5 things planners need to know about self-driving vehicles
 
Dr Chris Stout Getting Better at Private Practice
Dr Chris Stout Getting Better at Private PracticeDr Chris Stout Getting Better at Private Practice
Dr Chris Stout Getting Better at Private Practice
 
綻放的
綻放的綻放的
綻放的
 

Similar to Learn jobDSL for Jenkins

CICD Pipeline configuration as a code
CICD Pipeline configuration as a codeCICD Pipeline configuration as a code
CICD Pipeline configuration as a code
Grid Dynamics
 
Take control of your Jenkins jobs via job DSL.
Take control of your Jenkins jobs via job DSL.Take control of your Jenkins jobs via job DSL.
Take control of your Jenkins jobs via job DSL.
Łukasz Proszek
 
Jenkins Job DSL plugin
Jenkins Job DSL plugin Jenkins Job DSL plugin
Jenkins Job DSL plugin
Nikita Bugrovsky
 
Angular Optimization Web Performance Meetup
Angular Optimization Web Performance MeetupAngular Optimization Web Performance Meetup
Angular Optimization Web Performance Meetup
David Barreto
 
The power of dots
The power of dotsThe power of dots
The power of dots
Frank van der Linden
 
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
Eric Smalling
 
Oracle WebLogic: Feature Timeline from WLS9 to WLS 12c
Oracle WebLogic: Feature Timeline from WLS9 to WLS 12cOracle WebLogic: Feature Timeline from WLS9 to WLS 12c
Oracle WebLogic: Feature Timeline from WLS9 to WLS 12c
frankmunz
 
Advanced Node.JS Meetup
Advanced Node.JS MeetupAdvanced Node.JS Meetup
Advanced Node.JS Meetup
LINAGORA
 
Moving from CruiseControl.NET to Jenkins in the PVS-Studio development team
Moving from CruiseControl.NET to Jenkins in the PVS-Studio development teamMoving from CruiseControl.NET to Jenkins in the PVS-Studio development team
Moving from CruiseControl.NET to Jenkins in the PVS-Studio development team
PVS-Studio
 
Moving from CruiseControl.NET to Jenkins in the PVS-Studio development team
Moving from CruiseControl.NET to Jenkins in the PVS-Studio development teamMoving from CruiseControl.NET to Jenkins in the PVS-Studio development team
Moving from CruiseControl.NET to Jenkins in the PVS-Studio development team
Sofia Fateeva
 
Learning Docker with Thomas
Learning Docker with ThomasLearning Docker with Thomas
Learning Docker with Thomas
Thomas Tong, FRM, PMP
 
Eclipse Buildship JUG Hamburg
Eclipse Buildship JUG HamburgEclipse Buildship JUG Hamburg
Eclipse Buildship JUG Hamburg
simonscholz
 
Docker Introduction.pdf
Docker Introduction.pdfDocker Introduction.pdf
Docker Introduction.pdf
OKLABS
 
Continuous delivery the french way Agile Cambridge 2014
Continuous delivery the french way Agile Cambridge 2014Continuous delivery the french way Agile Cambridge 2014
Continuous delivery the french way Agile Cambridge 2014
Dimitri Baeli
 
Git Tutorial
Git TutorialGit Tutorial
Git Tutorial
Nael Abd Eljawad
 
Let me introduce you: DOTS
Let me introduce you: DOTSLet me introduce you: DOTS
Let me introduce you: DOTS
Frank van der Linden
 
Illia shestakov - The Future of Java JDK #9
Illia shestakov - The Future of Java JDK #9Illia shestakov - The Future of Java JDK #9
Illia shestakov - The Future of Java JDK #9
Anna Shymchenko
 
Configuration Management and Transforming Legacy Applications in the Enterpri...
Configuration Management and Transforming Legacy Applications in the Enterpri...Configuration Management and Transforming Legacy Applications in the Enterpri...
Configuration Management and Transforming Legacy Applications in the Enterpri...
Docker, Inc.
 

Similar to Learn jobDSL for Jenkins (20)

CICD Pipeline configuration as a code
CICD Pipeline configuration as a codeCICD Pipeline configuration as a code
CICD Pipeline configuration as a code
 
Take control of your Jenkins jobs via job DSL.
Take control of your Jenkins jobs via job DSL.Take control of your Jenkins jobs via job DSL.
Take control of your Jenkins jobs via job DSL.
 
Jenkins Job DSL plugin
Jenkins Job DSL plugin Jenkins Job DSL plugin
Jenkins Job DSL plugin
 
Angular Optimization Web Performance Meetup
Angular Optimization Web Performance MeetupAngular Optimization Web Performance Meetup
Angular Optimization Web Performance Meetup
 
The power of dots
The power of dotsThe power of dots
The power of dots
 
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
 
Oracle WebLogic: Feature Timeline from WLS9 to WLS 12c
Oracle WebLogic: Feature Timeline from WLS9 to WLS 12cOracle WebLogic: Feature Timeline from WLS9 to WLS 12c
Oracle WebLogic: Feature Timeline from WLS9 to WLS 12c
 
Gradle como alternativa a maven
Gradle como alternativa a mavenGradle como alternativa a maven
Gradle como alternativa a maven
 
Advanced Node.JS Meetup
Advanced Node.JS MeetupAdvanced Node.JS Meetup
Advanced Node.JS Meetup
 
Moving from CruiseControl.NET to Jenkins in the PVS-Studio development team
Moving from CruiseControl.NET to Jenkins in the PVS-Studio development teamMoving from CruiseControl.NET to Jenkins in the PVS-Studio development team
Moving from CruiseControl.NET to Jenkins in the PVS-Studio development team
 
Moving from CruiseControl.NET to Jenkins in the PVS-Studio development team
Moving from CruiseControl.NET to Jenkins in the PVS-Studio development teamMoving from CruiseControl.NET to Jenkins in the PVS-Studio development team
Moving from CruiseControl.NET to Jenkins in the PVS-Studio development team
 
Learning Docker with Thomas
Learning Docker with ThomasLearning Docker with Thomas
Learning Docker with Thomas
 
Eclipse Buildship JUG Hamburg
Eclipse Buildship JUG HamburgEclipse Buildship JUG Hamburg
Eclipse Buildship JUG Hamburg
 
Docker Introduction.pdf
Docker Introduction.pdfDocker Introduction.pdf
Docker Introduction.pdf
 
Continuous delivery the french way Agile Cambridge 2014
Continuous delivery the french way Agile Cambridge 2014Continuous delivery the french way Agile Cambridge 2014
Continuous delivery the french way Agile Cambridge 2014
 
Git Tutorial
Git TutorialGit Tutorial
Git Tutorial
 
fast_bitcoin_data_mining
fast_bitcoin_data_miningfast_bitcoin_data_mining
fast_bitcoin_data_mining
 
Let me introduce you: DOTS
Let me introduce you: DOTSLet me introduce you: DOTS
Let me introduce you: DOTS
 
Illia shestakov - The Future of Java JDK #9
Illia shestakov - The Future of Java JDK #9Illia shestakov - The Future of Java JDK #9
Illia shestakov - The Future of Java JDK #9
 
Configuration Management and Transforming Legacy Applications in the Enterpri...
Configuration Management and Transforming Legacy Applications in the Enterpri...Configuration Management and Transforming Legacy Applications in the Enterpri...
Configuration Management and Transforming Legacy Applications in the Enterpri...
 

More from Larry Cai

Learn kubernetes in 90 minutes
Learn kubernetes in 90 minutesLearn kubernetes in 90 minutes
Learn kubernetes in 90 minutes
Larry Cai
 
Learn RabbitMQ with Python in 90mins
Learn RabbitMQ with Python in 90minsLearn RabbitMQ with Python in 90mins
Learn RabbitMQ with Python in 90mins
Larry Cai
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90mins
Larry Cai
 
Learn ELK in docker
Learn ELK in dockerLearn ELK in docker
Learn ELK in docker
Larry Cai
 
Software Engineer Talk
Software Engineer TalkSoftware Engineer Talk
Software Engineer Talk
Larry Cai
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using docker
Larry Cai
 
Build service with_docker_in_90mins
Build service with_docker_in_90minsBuild service with_docker_in_90mins
Build service with_docker_in_90mins
Larry Cai
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutes
Larry Cai
 
Learn Dashing Widget in 90 minutes
Learn Dashing Widget in 90 minutesLearn Dashing Widget in 90 minutes
Learn Dashing Widget in 90 minutes
Larry Cai
 
Learn REST API with Python
Learn REST API with PythonLearn REST API with Python
Learn REST API with PythonLarry Cai
 
Jenkins Scriptler in 90mins
Jenkins Scriptler in 90minsJenkins Scriptler in 90mins
Jenkins Scriptler in 90mins
Larry Cai
 
Lead changes in software development
Lead changes in software developmentLead changes in software development
Lead changes in software development
Larry Cai
 
Python in 90mins
Python in 90minsPython in 90mins
Python in 90mins
Larry Cai
 
Practical way to experience of Specification by Example
Practical way to experience of Specification by ExamplePractical way to experience of Specification by Example
Practical way to experience of Specification by ExampleLarry Cai
 
Experience from specification_by_examples
Experience from specification_by_examplesExperience from specification_by_examples
Experience from specification_by_examplesLarry Cai
 
Continuous Integration Introduction
Continuous Integration IntroductionContinuous Integration Introduction
Continuous Integration Introduction
Larry Cai
 
Agile & ALM tools
Agile & ALM toolsAgile & ALM tools
Agile & ALM tools
Larry Cai
 

More from Larry Cai (17)

Learn kubernetes in 90 minutes
Learn kubernetes in 90 minutesLearn kubernetes in 90 minutes
Learn kubernetes in 90 minutes
 
Learn RabbitMQ with Python in 90mins
Learn RabbitMQ with Python in 90minsLearn RabbitMQ with Python in 90mins
Learn RabbitMQ with Python in 90mins
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90mins
 
Learn ELK in docker
Learn ELK in dockerLearn ELK in docker
Learn ELK in docker
 
Software Engineer Talk
Software Engineer TalkSoftware Engineer Talk
Software Engineer Talk
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using docker
 
Build service with_docker_in_90mins
Build service with_docker_in_90minsBuild service with_docker_in_90mins
Build service with_docker_in_90mins
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutes
 
Learn Dashing Widget in 90 minutes
Learn Dashing Widget in 90 minutesLearn Dashing Widget in 90 minutes
Learn Dashing Widget in 90 minutes
 
Learn REST API with Python
Learn REST API with PythonLearn REST API with Python
Learn REST API with Python
 
Jenkins Scriptler in 90mins
Jenkins Scriptler in 90minsJenkins Scriptler in 90mins
Jenkins Scriptler in 90mins
 
Lead changes in software development
Lead changes in software developmentLead changes in software development
Lead changes in software development
 
Python in 90mins
Python in 90minsPython in 90mins
Python in 90mins
 
Practical way to experience of Specification by Example
Practical way to experience of Specification by ExamplePractical way to experience of Specification by Example
Practical way to experience of Specification by Example
 
Experience from specification_by_examples
Experience from specification_by_examplesExperience from specification_by_examples
Experience from specification_by_examples
 
Continuous Integration Introduction
Continuous Integration IntroductionContinuous Integration Introduction
Continuous Integration Introduction
 
Agile & ALM tools
Agile & ALM toolsAgile & ALM tools
Agile & ALM tools
 

Recently uploaded

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 

Recently uploaded (20)

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 

Learn jobDSL for Jenkins

  • 2. Agenda  Introduction  Exercise 1: Run the example to know the power  Exercise 2: Hello World – first DSL  Exercise 3: One complete JobDSL  Exercise 4: JenkinsView and Loop  Exercise 5: Configure Block to extend DSL  Reference 2 08/12/15
  • 3. Environment Preparation (docker)  Boot2docker Installer (127M)  Contains latest docker already, fast  Container persistence via disk automount on /var/lib/docker  $ docker -v  User/Passwd: docker/tcuser (192.168.59.103)  Download Jenkins JobDSL docker images  $ docker pull larrycai/jenkins-jobdsl  Notepad++ & MobaXterm are recommended 3 08/12/15 http://boot2docker.io/
  • 4. Introduction  Jenkins is a de-facto CI standard used for lots of products  Easy to start, configure and extending (300+ plugins)  Configure jobs in UI mostly  Weak parts:  Update git repo for many jobs  Create dozens of jobs in fly for new project  Monitor the changes 4 08/12/15 Learn new way to configure jenkins Jobs
  • 5. Exercise 1: Hello World  Run first app inside docker environment $ cd /c/<Users>/codingwithme/jobdsl # create in advance $ docker run -it –v $PWD:/opt/jenkins/data/jobs/jobdsl/workspace -p 8080:8080 larrycai/jenkins-jobdsl  Browse: http://192.168.59.103:8080 Clean jenkins UI with one Job “HelloWorld”  Exercise : 1. Execute job “HelloWorld”, and check result 2. See configuration 3. Run it again 4. Delete job “Compile-DSL-Tutorial-0” and Update job “Package-DSL- Tutorial-0” and Run it again 5 08/12/15
  • 6. JobDSL is Groovy based  DSL : Domain Specific Language, easy to read and understand  JobDSL is jenkins plugin, https://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin  Groovy based 6 08/12/15 • Groovy is a multi-faceted language for the Java platform • Groovy used in jenkins to access internal data
  • 7. JobDSL & Idempotent  JobDSL helps to simplify the maintenance of jenkins jobs  An idempotent operation is one that can be applied multiple times without changing the result beyond the initial application  Keep the environment stable, reliable  No matter the job is changed by someone, if the jobDSL script is run, it will reach to the desired status 7 08/12/15
  • 8. Exercise 2:Hello World  Configure “HelloWorld” job  Replace script like below freeStyleJob("Hello2") { steps { shell('echo "Hello Larry"') } }  Select option “Action for removed jobs” to “Delete” and option “Action for removed views” to “Delete”, Run it again 8 08/12/15
  • 9. Jenkins Job mapping to JobDSL 9 08/12/15  Job Type (freeStyleJob)  Build Parameters (parameters)  SCM (scm)  BuildTriggers (triggers)  Steps (steps)  Post Build Actions (publishers) https://github.com/jenkinsci/job-dsl-plugin/wiki/Job-reference
  • 10. Exercise 3: Complete JobDSL example  Follow the existing Jenkins job “Sample” and convert it into JobDSL in “jobdsl”  Cover Scm/trigger/shell/archive  Steps:  New job “jobdsl” (freestyle)  New build step – Process Job DSLs  Choose “Look on Filesystem”  complete.groovy  In file, use freeStyleJob(“Hello3”)  Edit it in Windows env. (codingwith/jobdsl) # mapped into docker  Compare the result 10 08/12/15 Reference: https://github.com/jenkinsci/job-dsl-plugin/wiki/Job-reference
  • 11. Jenkins View & Groovy DSL  JenkinsView is simple as jobs  Name/filter/column .  Learn some groovy to handle common tasks  Loop  Read & Parse external config files 11 08/12/15
  • 12. Exercise 4: List View and Loop  Create different ListView and generate multi jobs based on the config file  Based on HelloWorld Example for jobs  Json file: HelloWorld/workspace/views.json  Steps  Create new view.groovy  Run inside job jobdsl 12 08/12/15
  • 13. Configure block  Not every jenkins Plugin are supported in JobDSL (may changes in the future)  Raise issues to get support  Configure blocks are used inside the Job DSL to give direct access to underlying XML of the Jenkins config.xml 13 08/12/15 https://github.com/jenkinsci/job-dsl-plugin/wiki/The-Configure-Block
  • 14. Exercise 5: Configure Block for testNG  Change the Sample job to export testNG result, which is not support by jobDSL yet.  Steps:  Configure Sample job to publish testNG result in post-build  Check generate config.xml http://localhost:8080/view/CodingWithMe/job/Sample/config.xml  Write testng.groovy based on complete.groovy  Generate job Hello5  Compare result 14 08/12/15
  • 15. Summary  JobDSL is the powerful to simplify the maintenance of your jenkins jobs and keep it in professional way  Put jobDSL scripts in git repo  What we learn  Execute JobDSL in jenkins jobs  Inside script & script file  Create job/View in jobDSL  Simple Groovy knowledge to handle loop/read external data  Configure Block in jobDSL to handle not direct supported plugins 15 08/12/15
  • 16. Reference  jobDSL slides  http://www.slideshare.net/daspilker/configuration-as-code-the-job-dsl-plugin  JobDSL ref  https://github.com/jenkinsci/job-dsl-plugin/wiki/View-Reference  https://github.com/jenkinsci/job-dsl-plugin/wiki/Job-reference  https://github.com/jenkinsci/job-dsl-plugin/wiki/The-Configure-Block  Groovy Json  http://www.groovy-lang.org/json.html  Exercise Gist  https://gist.github.com/larrycai/aeb9a3b037dcb17df9b2 16 08/12/15
  • 17. CodingWithMe  "CodingWithMe - Learning by Coding" is a coding workshop, it aims to learn one technology in 90 minutes by practice  Features:  4-5 well tuned hands on exercises in 90 minutes  First exercise shall be started in 20 minutes  It well follows Bob Pike’s 90/20/8 rules (happen to know)  It is recommended arranged for several parallel sessions if it is organized in the company. 17 08/12/15 http://www.larrycaiyu.com/blog/2014/03/18/codingwithme_introduction/