John Ferguson Smart
Wakaleo Consulting
Continuous Integration 101
Who is this guy, anyway?
John Ferguson Smart
Consultant	
  
Trainer	
  
Mentor	
  
Author	
  
Speaker	
  
Coder
Development without CI
Lots of bugs
Infrequent
commits
Source code repository
Difficult
integration
Testing happens
late
Infrequent
releases
Development without CI
Lots of bugs
Infrequent
commits
Source code repository
Difficult
integration
Testing happens
late
Infrequent
releases
»Insufficient testing!
»Slow release process!
»Poor project visibility!
»Issues raised are harder to fix!
»…
Development without CI
Lots of bugs
Infrequent
commits
Source code repository
Difficult
integration
Testing happens
late
Infrequent
releases
»Project Delays!
»Unhappy clients!
»High maintenance costs!
»Inflexible code bases!
»Harder to deliver real value!
»…
Introducing Continuous Integration
Regular
commits
Source code repository
Testing happens early
and oftenTest Server
Regular
automated
releases
Dedicated
Build Server
» Automated build
» Automated tests
» Automated code quality metrics
» …
Fewer bugs
» Automated build
» Automated tests
» Automated code quality metrics
» …
Introducing Continuous Integration
Regular
commits
Source code repository
Testing happens often
Dedicated
Build Server
Test Server
Regular
automated
releases
Fewer bugs
»Smoother integration process!
»Automated regression tests!
»Regular working releases!
»Better visibility!
»Find and fix issues faster and more easily!
»…
Continuous Integration Basics
The CI Starter Kit
• What you really need…
An automated build process
An automated test suite
A Continuous Build server
A source code repository
You need an automated build
Build from the command line
Build consistently on any machine
Build from source on any machine
You need automated deployment
STAGING
INTEGRATION
PROD
DEV
Build ServerSource code repository
You need an automated test suite
• Unit tests
• Integration tests
• Acceptance tests
• Performance tests
• …
You need an automated test suite
You need an automated test suite
• Automated code quality metrics
• Code coverage
• Coding standards
• Potential bugs
• …
You need a version control system
• Store (almost) everything in version control
–Source code
–Test code
–Build scripts
–Build tools
–Configuration scripts
–…
You need a version control system
• Or use a local artifact repository for binaries
– Nexus or Artifactory for JAR files
– NuGet mirror for .NET (e.g. MyGet)
– npm_proxy_cache for Node.js
– …
You need a version control system
Be wary of long-lived branches
Trunk-Based Development
Google builds off Trunk
You need a CI tool
You need a CI tool
Keep tabs on test results
What broke?
When did it break?
How long did it take?
What was tested?
You need a CI tool
Notify the right people fast
You need a CI tool
Keep tabs on application performance
You need a CI tool
Publish Living Documentation
You need a CI tool
Deliver Continuously
A simple build pipeline
Build	
  and	
  Fast	
  Tests
Slower	
  Tests
Acceptance	
  Tests
Code	
  Quality	
  Metrics
Release	
  Candidate
Deploy	
  to	
  Test
Deploy	
  to	
  UAT
Deploy	
  to	
  Produc=on
1.0.1
THANK YOU!
John	
  Ferguson	
  Smart	
  
Email:	
  john.smart@wakaleo.com	
  
Web:	
  hJp://www.wakaleo.com	
  
TwiJer:	
  wakaleo
Continuous Integration 101

Continuous Integration 101

  • 1.
    John Ferguson Smart WakaleoConsulting Continuous Integration 101
  • 2.
    Who is thisguy, anyway? John Ferguson Smart Consultant   Trainer   Mentor   Author   Speaker   Coder
  • 4.
    Development without CI Lotsof bugs Infrequent commits Source code repository Difficult integration Testing happens late Infrequent releases
  • 5.
    Development without CI Lotsof bugs Infrequent commits Source code repository Difficult integration Testing happens late Infrequent releases »Insufficient testing! »Slow release process! »Poor project visibility! »Issues raised are harder to fix! »…
  • 6.
    Development without CI Lotsof bugs Infrequent commits Source code repository Difficult integration Testing happens late Infrequent releases »Project Delays! »Unhappy clients! »High maintenance costs! »Inflexible code bases! »Harder to deliver real value! »…
  • 7.
    Introducing Continuous Integration Regular commits Sourcecode repository Testing happens early and oftenTest Server Regular automated releases Dedicated Build Server » Automated build » Automated tests » Automated code quality metrics » … Fewer bugs
  • 8.
    » Automated build »Automated tests » Automated code quality metrics » … Introducing Continuous Integration Regular commits Source code repository Testing happens often Dedicated Build Server Test Server Regular automated releases Fewer bugs »Smoother integration process! »Automated regression tests! »Regular working releases! »Better visibility! »Find and fix issues faster and more easily! »…
  • 9.
  • 10.
    The CI StarterKit • What you really need… An automated build process An automated test suite A Continuous Build server A source code repository
  • 11.
    You need anautomated build Build from the command line Build consistently on any machine Build from source on any machine
  • 12.
    You need automateddeployment STAGING INTEGRATION PROD DEV Build ServerSource code repository
  • 13.
    You need anautomated test suite • Unit tests • Integration tests • Acceptance tests • Performance tests • …
  • 14.
    You need anautomated test suite
  • 15.
    You need anautomated test suite • Automated code quality metrics • Code coverage • Coding standards • Potential bugs • …
  • 16.
    You need aversion control system • Store (almost) everything in version control –Source code –Test code –Build scripts –Build tools –Configuration scripts –…
  • 17.
    You need aversion control system • Or use a local artifact repository for binaries – Nexus or Artifactory for JAR files – NuGet mirror for .NET (e.g. MyGet) – npm_proxy_cache for Node.js – …
  • 18.
    You need aversion control system Be wary of long-lived branches
  • 19.
  • 20.
    You need aCI tool
  • 21.
    You need aCI tool Keep tabs on test results What broke? When did it break? How long did it take? What was tested?
  • 22.
    You need aCI tool Notify the right people fast
  • 23.
    You need aCI tool Keep tabs on application performance
  • 24.
    You need aCI tool Publish Living Documentation
  • 25.
    You need aCI tool Deliver Continuously
  • 26.
    A simple buildpipeline Build  and  Fast  Tests Slower  Tests Acceptance  Tests Code  Quality  Metrics Release  Candidate Deploy  to  Test Deploy  to  UAT Deploy  to  Produc=on 1.0.1
  • 27.
    THANK YOU! John  Ferguson  Smart   Email:  john.smart@wakaleo.com   Web:  hJp://www.wakaleo.com   TwiJer:  wakaleo