Continuous Integration 101
-
Upload
wakaleo-consulting -
Category
Technology
-
view
2.356 -
download
1
Transcript of Continuous Integration 101
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 bugsInfrequent commits
Source code repository
Difficult integration
Testing happens late
Infrequent releases
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!»…
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!»…
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 buildBuild 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 systemBe wary of long-lived branches
Trunk-Based DevelopmentGoogle builds off Trunk
You need a CI tool
You need a CI toolKeep tabs on test results
What broke?
When did it break?
How long did it take?
What was tested?
You need a CI toolNotify 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 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