Continuous Integration
Jumpstart CI with Jenkins Workflow

@udaypal
1
Topics
• Economics of Continuous Integration

• What is Continuous Integration?

• Practicing continuous integration 

• Continuous Integration with Jenkins

• Jenkins workflow

• Q & A
2
About Me
• Director, Solutions Architect

• Open Source Evangelist

• Developer @ heart

• Occasional Committer

• Soccer referee
3
Who we are
• CloudBees Founded in 2010
• The Jenkins Enterprise Company
• Core Contributors
• Products
• Jenkins Enterprise
• Jenkins Operation Center
• Support, Training, Consulting, JUC etc..
4
Economics of CI
5
6
Economics
Source	
  :	
  Applied	
  So*ware	
  Measurement,	
  Capers	
  Jones,	
  1996
Time
$
Developer
Computer
7
Economics
What is CI?
8
What is CI?
Continuous Integration (CI) is a development practice that
requires developers to integrate code into a shared
repository several times a day. Each check-in is then
verified by an automated build, allowing teams to detect
problems early.

By integrating regularly, you can detect errors quickly,
and locate them more easily.
9
Version
Control
Build &
Unit Tests
Functional
Tests
Acceptance
Tests
ReleaseDevelopment
Checkin
Trigger
Feedback
Checkin
Trigger
Feedback Trigger
Feedback
Checkin
Trigger
Feedback Trigger
Feedback
Feedback
Approved
Approved
10
Practicing CI
11
Continuous Integration
Practicing	
  Continuous	
  Integration
• Central Repository

• Build every commit

• Automate builds

• Builds are self-testing

• Fail fast, build fast

• Test in production clone

• Automate deployment(s)

• Analyze
12
Change'
Build'
Test'Deploy'
Analyze'
Continuous Integration
Team	
  Responsibilities
• Commit Early, commit often

• Never commit broken, untested code

• Broken builds are the highest priority

• Don’t checkin when build is broken

• Make sure last checkin of day doesn’t break build
13
Jenkins and CI
14
Jenkins
• 1000

• 597

• 70

• 8

• 1
15
- Over 1000 Plugin 

- Over 500+ weekly releases

- 70% Market

- 8+ Years

- #1 CI Server
Jenkins
16
What type of tasks do you use Jenkins for?
Build
Test
Code Analysis
Batch Tasks
Release
Operations
Deployment
Other
0% 25% 50% 75% 100%
5.37%
47.81%
14.95%
48.37%
38.47%
64.07%
86.42%
95.19%
Jenkins
Hub	
  Of	
  Continuous	
  Delivery
17
Binaries
Code
Analysis
SCM Production
Functional
Tests
Perf / Load
Test
Jenkins CI
Old	
  Workflows
• Copy Artifacts

• Build Triggers

• Build Flow

• Build Pipeline

• Build Delivery Pipeline
18
Jenkins CI
Complex	
  Job	
  Chaining
• Many atomic jobs

• Mix build triggers, parameterized build …

• Limited logic

• Hard to share variables / state between jobs

• Cannot survive restart

• Disjointed views & configuration sprawl
19
Jenkins Workflow
Features
• One job to capture complex pipeline

• Based on Groovy

• Can survive restarts

• Throttle builds

• Human input

• Visualization
20
Summary
• CI is cost effective

• CI reduces manual error prone processes

• CI enables better visibility

• CI establishes greater confidence 

• CI is a necessary step towards CD

• Jenkins is awesome @ CI
21
22

Continuous Integration