2. Agenda:
1. What is CI
2. Risks of building a software
3. Risk mitigation with CI
4. 7 step program
5. World with/without CI
6. Simple CI pipeline
7. CI starter kit
8. Sample CI workflow
3. Risks of s/w building
Building s/w can be a risky business! Right?
Risk# 1: Fixing bugs late is costly
Risk# 2: Lack of team cohesion (Eg: your changes are incompatible with mine. How to merge
now? Eg: when did we decide to upgrade to version 2 of this library? Etc..)
Risk# 3: poor quality code base. Creating classes which are duplicate;
Risk# 4: lack of project visibility. Whats in version 1?; whats our code coverage now? What
do you mean tests are failing?
Risk# 5: lack of deployable s/w. It works on my machine; customer needs a demo now!;
need a new build to test;
4. What is Not CI
• Nightly builds;
• Developer branches;
• Scheduled integration points;
• Building via IDEs
Continuous compilation != Continuous Integration
5. What is CI
• A development methodology;
• About daily developer/tester integrations;
• Verified by automated builds
Building software Better, Faster, Cheaper
6. Risk mitigation with ci
Better:
• Build better quality s/w
• Tested early and often
• Adheres to best practices and coding standards
Faster:
• Test in parallel, not at the end. (Real quality cannot be injected at the end. It
must be part of the process
• No integration points
• Builds become a non event
Cheaper:
• Identify defects earlier
• Fix when least costly
• Easily repeatable testing
7. 7 Step Process
1. Commit early, commit often;
2. Never commit broken code
3. Fix build failures immediately
4. Fail fast
5. Act on metrics
6. Build in every target environment
7. Create artifacts from every build
CI can help you build better quality software faster, with more
confidence
8. Without CI
Lots of bugs Project delays
Infrequent commits Unhappy clients
Difficult integration High maintenance costs
Infrequent releases Inflexible code bases
Testing happens late Harder to deliver real value
Insufficient testing
Slow release process
Poor project visibility
Issues raised are harder to fix
9. With CI
Regular commits Smoother integration process
Automated build Automated regression tests
Automated tests Regular working releases
Automated code quality metrics Better visibility
Dedicated build server Find and fix issues faster and more easily
Regular automated releases
Test server
Fewer bugs
Testing happens early and often
10. Simple ci pipeline
Build and Fast tests
Slower tests
Acceptance tests
Code quality metrics
Release candidate
Deploy to Test
Deploy to UAT
Deploy to Prod
11. CI Starter kit
An automated build process
build from cmdline
build consistently on any machine
build from source on any machine
An automated test suite
A source code repository
A continuous build server
12. CI workflow
github
1. Developer pulls
from github
2. Developer writes
and tests code
Gerrit
3. Developer pushes
changeset to Gerrit
7. On approval Gerrit merges &
pushes to github
Jenkins
4. Jenkins builds & tests
change (triggered)
5. Jenkins updates
changeset on Gerrit
6. Another developer reviews
the changeset
8. Jenkins pulls from github,
builds, tests and publishes