ContinuousIntegration 101 
by Manuel Spezzani 
Bologna, October30, 2014
Manuel Spezzani 
Technical Lead 
IConsulting S.p.A. 
m.spezzani@iconsulting.biz 
manuel@indyco.com 
@manuelspezzani 
http://it.linkedin.com/in/manuelspezzani/it
Me, myself& indyco
WhatisContinuousIntegration
Continousintegrationbefore
Continousintegrationafter
A basiccontinuousintegrationprocess 
At everycommit: 
Getlatestsources 
Build 
Test 
Package 
Evenifoneminortest fails, the buildismarkedasRED
A basiccontinuousintegrationprocess 
No IDE allowed! 
Sourcescomesfrom ONE repository 
Buildscripts are sources 
Database scripts are sources 
Test everything! 
Database scripts countsaseverything 
No-oneneeds100% coverage, everyoneneeds100% confidence!
Continousintegrationand me 
More discipline 
Checkinfrequently 
Don’tcheckinbroken/ untestedcode! 
Don’tcheckinwhenthe buildisbroken 
Don’t go home after checking in until the system builds 
http://www.thoughtworks.com/continuous-integration
Why?
Efficiency 
AutomateEverything 
No monkey-work 
Coded, self-documentedprocesses
Reproducibility 
Reduce human errors 
Artifactversioningand traceability
Release early–release often 
Ensurethe mainlineisalwaysshippable 
Reduce packaging and release time
Multiple configurations 
Environment 
OS 
Browsers 
Network 
… 
Third-party integrations 
Databases 
Libraries 
…
Whereto start?
Set a goal: 1-click release 
Clear and easy to measure 
It’seasy to estimate a «ROI» 
Youcan sell itto yourboss! 
Involvesa lotof processes 
Probablyitwillchangethe way youwork
Set rules, and followthem 
Developers haveno accessto C.I. servers 
No log-in access 
No file-systemaccess 
No-oneisallowedto release manually
Build== Code 
Codingprinciplesapplies 
KISS 
DRY 
YAGNI 
… 
The buildshouldevolve with yourproject
Wichone?
Anti-Patterns
Fragility 
Occasionalfailures 
«Don’tstop thatbuild» syndrome
Interference 
Sharedresources 
Limitationon concurrentbuild 
Limitationon concurrenttests
Reproducibility 
Dependencyhell 
Developers haveto accessthe CI machinesto throubleshootbuildissues 
The buildscript can’tbe executeda standard devmachine
Poorfeedback 
The buildtakestoolong 
Email notifications
Movingforward
Personal build
Nightlybuildasa companion 
Usefulwhen: 
Workingon large projects, with lotof integration/ UI tests 
Resource intensive builds 
Be careful: 
Dailyintegrationisnotenough! 
http://www.alittlemadness.com/2009/01/27/continuous-integration-myth-ci-vs-nightly-builds/
Continuousdelivery 
Your software is deployablethroughout its lifecycle 
You can perform push-button deployments of any version of the software to any environment on demand 
http://martinfowler.com/bliki/ContinuousDelivery.html 
http://blog.crisp.se/2013/02/05/yassalsundman/continuous-delivery-vs-continuous-deployment
Continuousdeployment 
Your software is deployedthroughout its lifecycle 
Is it a good idea or not? It depends on your business! 
http://blog.crisp.se/2013/02/05/yassalsundman/continuous-delivery-vs-continuous-deployment
…and more! 
Automatedperformance check 
Git(Hub) Flow 
…
ContinuousIntegration 101 
by Manuel Spezzani 
Bologna, October30, 2014

Continuous integration 101