Continuous Integration 101

28
John Ferguson Smart Wakaleo Consulting Continuous Integration 101

Transcript of Continuous Integration 101

Page 1: Continuous Integration 101

John Ferguson Smart Wakaleo Consulting

Continuous Integration 101

Page 2: Continuous Integration 101

Who is this guy, anyway?

John Ferguson Smart

Consultant  Trainer  Mentor  Author  Speaker  Coder

Page 3: Continuous Integration 101
Page 4: Continuous Integration 101

Development without CI

Lots of bugsInfrequent commits

Source code repository

Difficult integration

Testing happens late

Infrequent releases

Page 5: Continuous Integration 101

Development without CI

Lots of bugsInfrequent 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!»…

Page 6: Continuous Integration 101

Development without CI

Lots of bugsInfrequent 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!»…

Page 7: Continuous Integration 101

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

Page 8: Continuous Integration 101

» 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!»…

Page 9: Continuous Integration 101

Continuous Integration Basics

Page 10: Continuous Integration 101

The CI Starter Kit• What you really need…

An automated build process

An automated test suite

A Continuous Build server

A source code repository

Page 11: Continuous Integration 101

You need an automated buildBuild from the command line

Build consistently on any machine

Build from source on any machine

Page 12: Continuous Integration 101

You need automated deployment

STAGING

INTEGRATION

PROD

DEV

Build ServerSource code repository

Page 13: Continuous Integration 101

You need an automated test suite• Unit tests • Integration tests • Acceptance tests • Performance tests • …

Page 14: Continuous Integration 101

You need an automated test suite

Page 15: Continuous Integration 101

You need an automated test suite• Automated code quality metrics

• Code coverage • Coding standards • Potential bugs • …

Page 16: Continuous Integration 101

You need a version control system• Store (almost) everything in version control

–Source code –Test code –Build scripts –Build tools –Configuration scripts –…

Page 17: Continuous Integration 101

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 – …

Page 18: Continuous Integration 101

You need a version control systemBe wary of long-lived branches

Page 19: Continuous Integration 101

Trunk-Based DevelopmentGoogle builds off Trunk

Page 20: Continuous Integration 101

You need a CI tool

Page 21: Continuous Integration 101

You need a CI toolKeep tabs on test results

What broke?

When did it break?

How long did it take?

What was tested?

Page 22: Continuous Integration 101

You need a CI toolNotify the right people fast

Page 23: Continuous Integration 101

You need a CI tool

Keep tabs on application performance

Page 24: Continuous Integration 101

You need a CI tool

Publish Living Documentation

Page 25: Continuous Integration 101

You need a CI tool

Deliver Continuously

Page 26: Continuous Integration 101

A simple build pipelineBuild  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

Page 27: Continuous Integration 101

THANK YOU!

John  Ferguson  Smart  Email:  [email protected]  Web:  hJp://www.wakaleo.com  

TwiJer:  wakaleo

Page 28: Continuous Integration 101