SlideShare a Scribd company logo
Version your build process as you version your code
Vincent Latombe
@Vlatombe
Footer
#jenkinsconf
The speaker
Software Engineer at CloudBees
Heavy Jenkins user since 2010
Maintainer of the Clearcase plugin
Contributes to core, git and literate
2
Footer
#jenkinsconf
Agenda
What is Literate ?
Literate in Practice
Literate in real life
Under the hood
3
#jenkinsconf
What is Literate?
Footer
#jenkinsconf
Literate Programming
• Introduced by Donald
Knuth in 1983
• Explain program logic
using natural language
with snippets of code and
macros
5
Footer
#jenkinsconf
Literate Builds
• Applies Literate paradigm to builds
• Describes the build steps in a marker file

or simply in README.md
• Build definition stored in the same SCM

as the code it is building
6
Footer
#jenkinsconf
Literate Builds
• Marker file within the SCM
• May contain the build
definition
• Fallback to README.md if
empty
7
Footer
#jenkinsconf
Markdown Cheatsheet
A section
=========
This is text inside section.
And `this is inline code`.
some code
8
Footer
#jenkinsconf
Hello world example
Hello world literate project
============================
Build
-----
Let's say hello
echo "Hello world"
9
Footer
#jenkinsconf
Ant example
Environments
===========
Notice how we specify the environment to build with by providing Jenkins node labels or tool installer names in code
snippet sections attached to bullet points in an "environment" section?
* `ant-1.8`, `java-1.7`
Build
=====
ant clean dist
10
Footer
#jenkinsconf
Matrix build? No problem
Complex project
===============
Environments
===========
We have two different environments that the build must be run on:
* `linux`, `gcc-4.2`, `ant-1.8`, `maven-3.0.5`, `java-1.7`
* `windows`, `vs-pro-2012`, `ant-1.8`, `maven-3.0.5`, `java-1.7`
11
Footer
#jenkinsconf
Build commands per environment
Build
=====
We have two different sets of build instructions, one for building with visual studio and the other for building with GCC
* On `gcc-4.2`, we start by building the native code
./configure
make
* On `vs-pro-2012`, we have a batch file to do the native steps
call build-native.bat
12
Footer
#jenkinsconf
Additional tasks
• Defined in the marker file
• Enabled per branch using the job configuration
• Lightweight promotion
– Self-promotion
– Manual promotion (with optional parameters)
13
Footer
#jenkinsconf
Extensions (1/2) : job configuration
• Things you want as a Jenkins admin
– Timestamp logs
– Discard old builds
– Clean up workspace before build
– Notification to GitHub/Stash
– Use Branch Properties
14
Footer
#jenkinsconf
Extensions (2/2) : in SCM
• Things you leave up to the developer
– Files stored in SCM under .jenkins folder
– Basic: <extensionName>.xml, contains the config snippet
found in config.xml
– Implement Agent to expose higher-level configuration files
– location of test results
– coverage threshold
15
#jenkinsconf
Literate in practice
Footer
#jenkinsconf
Installation
• Set up experimental update center
• http://updates.jenkins-ci.org/experimental/update-center.json
• Check for updates
• Install Literate plugin and dependencies
• Restart if needed
17
Footer
#jenkinsconf
DEMO TIME !
• https://github.com/Vlatombe/literate-sample
18
#jenkinsconf
Literate in real life
Footer
#jenkinsconf
Context
• About 3000 developers
• Commercial products
– ~1000 Java/JEE
– ~2000 C++
• For internal tooling, add
– Python
– Ruby
– Perl
20
Footer
#jenkinsconf
It’s about control!
• Fully open
• Locked down
• Balanced
– Template-based solutions: only defined attributes can be customized
– Literate: commands can be customized, post-build actions can be whitelisted
21
Footer
#jenkinsconf
Infrastructure
22
Stash Jenkins
❑ 1.Enable CI
2.Creates
3.Index branches
4.Parses marker
Literate Multi-
branch
project
Literate
branch
project
Project/
Repository
Literate env.
project
Literate env.
project
5.Update build status
Footer
#jenkinsconf
YAML Parser
• Markdown considered too textual, too much space for syntax
errors, even if using README.md was tempting
• YAML fanboys
• New parser was easy to implement thanks to existing Literate
architecture
23
Footer
#jenkinsconf
Markdown vs YAML
Environments
============
* `windows`, `java-1.6`
* `linux`, `java-1.7`
Build
=====
mvn –B clean verify
24
environments:
- [windows, java-1.6]
- [linux, java-1.7]
build: mvn –B clean verify
YAMLMarkdown
versus
#jenkinsconf
Under the hood
Footer
#jenkinsconf
Architecture
26
Literate-plugin
Literate-api
Branch-api
Scm-api
Footer
#jenkinsconf
Literate-api
• Builds a Project Model from a text file
• Doesn’t depend on Jenkins
• Pluggable model builders
– Markdown
– YAML
27
Footer
#jenkinsconf
Scm-api
• jenkins.scm.api.SCMSource : provider for hudson.scm.SCM
instances
• Able to comprehend multiple heads on a SCM
– Git branches
– Github pull requests
– Gerrit reviews
28
Footer
#jenkinsconf
Branch-api
• Toolkit to handle multi-branch
– Dead branch policy
– Untrusted branches
– Build retention
– Throttling
• Foundation for
– Multi-branch freestyle project
– Multi-branch template project
– Multi-branch workflow (see demo by @tyvole at 1pm)
29
Footer
#jenkinsconf
Literate-plugin
• Extension points
– LiterateBranchProperty : decorate branch and environments with anything
(buildwrapper, properties…)
– Agent : Builds Publisher instances from files in the SCM.
30
Footer
#jenkinsconf
What’s next?
• Integration with multi-branch workflow
– Use the literate descriptor to feed a workflow
– Branch sources for GitHub, Bitbucket, Stash pull requests
– Additional plugins compatibility
• Essentially the same problem as with workflow, without the
necessary investment behind
31
Footer
#jenkinsconf
Takeout
• Drive your build process from your SCM
• Use a description markup, independant from Jenkins
• Proper multi-branch support!
• Give it a try !
32
#jenkinsconf
Footer
Thanks to our Sponsors!
33

More Related Content

PDF
CI/CD Pipeline as a Code using Jenkins 2
PPTX
Symfony Under Control by Maxim Romanovsky
PPTX
PPTX
Pipeline as code using Jenkins -Ministry of Testing
PDF
JUC Europe 2015: Bringing CD at Cloud-Scale with Jenkins, Docker and "Tiger"
PDF
ZF2: Writing Service Components
PDF
Jenkins : Pipeline As Code
PDF
Version Control with Subversion
CI/CD Pipeline as a Code using Jenkins 2
Symfony Under Control by Maxim Romanovsky
Pipeline as code using Jenkins -Ministry of Testing
JUC Europe 2015: Bringing CD at Cloud-Scale with Jenkins, Docker and "Tiger"
ZF2: Writing Service Components
Jenkins : Pipeline As Code
Version Control with Subversion

What's hot (20)

PPT
Subversion Overview
PDF
JUC Europe 2015: Enabling Continuous Delivery for Major Retailers
PPTX
Jenkins introduction
PDF
Jenkins-CI
PPTX
SD DevOps Meet-up - Jenkins 2.0 and Pipeline-as-Code
PPT
Class.mobilefirstfoundation.chapter.2.devops
PPTX
Getting Started With Subversion
PPTX
Jenkins CI presentation
PDF
Embedded Webinar #12 “GloDroid or Boosting True Open Source Android Stack Dev...
PPT
SVN Tool Information : Best Practices
PPTX
CollabSphere 2018: How to build your SmartCloud Notes hybrid environment
PPT
Part 4 - Managing your svn repository using jas forge
PPTX
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
PPTX
Introduction to Continuous Integration with Jenkins
PPTX
Jenkins presentation
PPTX
Jenkins for java world
PDF
2013 10-28 php ug presentation - ci using phing and hudson
PDF
JUC 2015 - Keynote Address and Opening Remarks by Kohsuke Kawaguchi, Founder,...
PDF
Changing application demands: What developers need to know
Subversion Overview
JUC Europe 2015: Enabling Continuous Delivery for Major Retailers
Jenkins introduction
Jenkins-CI
SD DevOps Meet-up - Jenkins 2.0 and Pipeline-as-Code
Class.mobilefirstfoundation.chapter.2.devops
Getting Started With Subversion
Jenkins CI presentation
Embedded Webinar #12 “GloDroid or Boosting True Open Source Android Stack Dev...
SVN Tool Information : Best Practices
CollabSphere 2018: How to build your SmartCloud Notes hybrid environment
Part 4 - Managing your svn repository using jas forge
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Introduction to Continuous Integration with Jenkins
Jenkins presentation
Jenkins for java world
2013 10-28 php ug presentation - ci using phing and hudson
JUC 2015 - Keynote Address and Opening Remarks by Kohsuke Kawaguchi, Founder,...
Changing application demands: What developers need to know
Ad

Similar to Version your build process as you version your code (20)

PPTX
Going literate in Amadeus JUC Berlin June 25th 2014
PDF
From Virtual Machines to Containers
PDF
JUC Europe 2015: From Virtual Machines to Containers: Achieving Continuous In...
PPTX
Symfony under control. Continuous Integration and Automated Deployments in Sy...
PPTX
Pipeline as code - new feature in Jenkins 2
PDF
Juc boston2014.pptx
PPTX
Build Time Hacking
PPTX
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
PDF
JUC Europe 2015: Hey! What Did We Just Release?
PPTX
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
PDF
Versioning for Developers
PPTX
Jenkins advance topic
PDF
jenkins.pdf
PDF
Jenkins_1679702972.pdf
PDF
Atlanta Jenkins Area Meetup October 22nd 2015
PDF
PPTX
Continous Integration.pptx
PPTX
Introduction to jenkins for the net developer
PDF
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
PDF
DevOps World | Jenkins World 2018 and The Future of Jenkins
Going literate in Amadeus JUC Berlin June 25th 2014
From Virtual Machines to Containers
JUC Europe 2015: From Virtual Machines to Containers: Achieving Continuous In...
Symfony under control. Continuous Integration and Automated Deployments in Sy...
Pipeline as code - new feature in Jenkins 2
Juc boston2014.pptx
Build Time Hacking
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
JUC Europe 2015: Hey! What Did We Just Release?
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Versioning for Developers
Jenkins advance topic
jenkins.pdf
Jenkins_1679702972.pdf
Atlanta Jenkins Area Meetup October 22nd 2015
Continous Integration.pptx
Introduction to jenkins for the net developer
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
DevOps World | Jenkins World 2018 and The Future of Jenkins
Ad

Recently uploaded (20)

PPT
Mechanical Engineering MATERIALS Selection
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
Lecture Notes Electrical Wiring System Components
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Geodesy 1.pptx...............................................
PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
DOCX
573137875-Attendance-Management-System-original
PDF
Well-logging-methods_new................
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
web development for engineering and engineering
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
additive manufacturing of ss316l using mig welding
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Mechanical Engineering MATERIALS Selection
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Lecture Notes Electrical Wiring System Components
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
OOP with Java - Java Introduction (Basics)
Geodesy 1.pptx...............................................
Structs to JSON How Go Powers REST APIs.pdf
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
573137875-Attendance-Management-System-original
Well-logging-methods_new................
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
web development for engineering and engineering
bas. eng. economics group 4 presentation 1.pptx
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
additive manufacturing of ss316l using mig welding
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx

Version your build process as you version your code