SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Continuous Integration
Motivation
The common software story:
Integration is a long and
unpredictable process.
But this need not be the way..
Integration can be a NON-Event !
Contents
• Building a Feature with Continuous Integration
• Practices of Continuous Integration
• Benefits of Continuous Integration
• Introducing Continuous Integration
Building a Feature with Continuous Integration
Checkout
the mainline
Add the
feature
Local Build
Committing:
1- Update working copy
2- Resolve conflicts if any
3- Repeat until synchronized
with mainstream
Build on Integration
machine.
Practices of Continuous Integration
CI
Practices
Single
Source
Repository
Automated
Build
Self-Testing
Build
Everyone
CommitsTo
the Mainline
Every Day
Build on an
Integration
Machine
Fast Build
Test in a
Clone of the
Production
Easy to Get
the Latest
Executable
Everyone
can see
what's
happening
Automated
Deployment
CI
Practices
Single
Source
Repository
Automate
the Build
Self-Testing
Build
Everyone
CommitsTo
the Mainline
Every Day
Build on an
Integration
Machine
Keep the
Build Fast
Test in a
Clone of the
Production
Easy to Get
the Latest
Executable
Everyone
can see
what's
happening
Automate
Deployment
1- Maintain a Single Source Repository
• The Rule:
“you should be able to do a checkout on a virgin machine and be able
to fully build the System.”
• The steps:
• Get a decent source control management system.
• Make sure it is the well known place for everyone to get the source.
• Not only code. Put every thing you need to build. (test scripts, properties files,..).
• Don’t overuse branches.
CI
Practices
Single
Source
Repository
Automate
the Build
Self-Testing
Build
Everyone
CommitsTo
the Mainline
Every Day
Build on an
Integration
Machine
Keep the
Build Fast
Test in a
Clone of the
Production
Easy to Get
the Latest
Executable
Everyone
can see
what's
happening
Automate
Deployment
2- AutomateThe Build
• Turning sources into executable is often a complicated process, and since it
can be automated, it Should be automated.
• A good automated build script:
• Every thing should be included(fetching DB scripts from repo and firing them).
• Analyze what was changed and replace the needed classes only.
• Should allow building different targets for different cases.
CI
Practices
Single
Source
Repository
Automate
the Build
Self-Testing
Build
Everyone
CommitsTo
the Mainline
Every Day
Build on an
Integration
Machine
Keep the
Build Fast
Test in a
Clone of the
Production
Easy to Get
the Latest
Executable
Everyone
can see
what's
happening
Automate
Deployment
3- MakeYour Build Self-Testing
• XP andTDD popularized “Self-Testing Code” concept.
• Self-Testing code:
“The practice of writing comprehensive automated tests, in conjunction
with functional software.”
3- MakeYour Build Self-Testing
• To have Self-Testing code you need:
• A suit of automated test with good coverage percent.
• Be able to kickoff the tests with simple command.
• The tests to be self checking.
• To have Self-Testing Build:
• Include the automated tests in the build process.
• The failure of a test should cause the build failure.
CI
Practices
Single
Source
Repository
Automate
the Build
Self-Testing
Build
Everyone
CommitsTo
the Mainline
Every Day
Build on an
Integration
Machine
KeepThe
Build Fast
Test in a
Clone of the
Production
Easy to Get
the Latest
Executable
Everyone
can see
what's
happening
Automate
Deployment
4- Everyone CommitsTo the Mainline Every Day
• Every developer should commit to the repository every day(at least).
• Benefits:
• The more frequent commits  less places to look for conflicts  more
rapidly conflicts get fixed! (diff-debugging).
• Encourage breaking down tasks into small chunks  easer to track
progress.
CI
Practices
Single
Source
Repository
Automate
the Build
Self-Testing
Build
Everyone
CommitsTo
the Mainline
Every Day
Build on an
Integration
Machine
Keep the
Build Fast
Test in a
Clone of the
Production
Easy to Get
the Latest
Executable
Everyone
can see
what's
happening
Automate
Deployment
5- Every Commit Should Build the Mainline on an Integration Machine
• Successful “local” builds is not enough.
• You should a separate Integration machine to avoid developers machines environment
differences issues.
• You should not go home until you get a successful build on the integration machine.
• Nightly builds are not enough for CI.(conflicts will stay undected for I day )
• Can be done in two ways:
• Manually
• Using Continues Integration server
5- Every Commit Should Build the Mainline on an Integration Machine
• Manually:
• Checkout the head of mainline.
• Kickoff the build.
• Keep an eye on it , until finish successfully.
5- Every Commit Should Build the Mainline on an Integration Machine
• RememberTravis ?
• The continues integration server should:
• Monitor the Repository
• Checks out the sources to the integration machine after each commit
• Initiate a build
• Send notification for the build status after completion.
CI
Practices
Single
Source
Repository
Automate
the Build
Self-Testing
Build
Everyone
CommitsTo
the Mainline
Every Day
Build on an
Integration
Machine
Keep the
Build Fast
Test in a
Clone of the
Production
Easy to Get
the Latest
Executable
Everyone
can see
what's
happening
Automate
Deployment
6- Keep the Build Fast
• Every minute reduced of build time =
a minute saved * per developer * per number of commits
• What is considered a “Fast” build?
• XP guidelines: 10 minutes build
• The usual bottleneck :Testing
• Specially tests that use services (like DB).
6- Keep the Build Fast
• Use a “Deployment Pipeline”
• Multiple builds done in sequence.
• The commit triggers the first build “commit build”
• Commit build should be fast  will use shortcuts(Test Double)
• Shortcuts  reduce ability to detect bugs!
• Should have balance between speed and bug finding
• Then slower tests can start to run, and additional machines can be used.
• Ensure that any large scale failure leads to new test added to the commit
build.
• Parallel secondary tests can be used to do more automated tests
type(performance for example)
CI
Practices
Single
Source
Repository
Automate
the Build
Self-Testing
Build
Everyone
CommitsTo
the Mainline
Every Day
Build on an
Integration
Machine
Keep the
Build Fast
Test in a
Clone of the
Production
Easy to Get
the Latest
Executable
Everyone
can see
what's
happening
Automate
Deployment
7-Test in a Clone of the Production Environment
• Set up test environment to be a mimic of production environment.
(DB software version, OS version, libraries, IPs, ports ..)
• Possible limitations:
1. Wide varieties (desktop applications)
2. Expensive
• However, still try to duplicate the environment as much as you can.
• Understand the risks you accept for every difference between test and
production environment.
• A growing option to overcome limitation: Virtualization
CI
Practices
Single
Source
Repository
Automate
the Build
Self-Testing
Build
Everyone
CommitsTo
the Mainline
Every Day
Build on an
Integration
Machine
Keep the
Build Fast
Test in a
Clone of the
Production
Easy to Get
the Latest
Executable
Everyone
can see
what's
happening
Automate
Deployment
8- Make it Easy for Anyone to Get the Latest Executable
• Make sure there is a well known place where people can get latest
executables.
• Can be useful to put several executables.
• Utilize the human behavior:
“It is mush easier to adjust something visibly exist, than to specify how it
should be in advance”
CI
Practices
Single
Source
Repository
Automate
the Build
Self-Testing
Build
Everyone
CommitsTo
the Mainline
Every Day
Build on an
Integration
Machine
Keep the
Build Fast
Test in a
Clone of the
Production
Easy to Get
the Latest
Executable
Everyone
can see
what's
happening
Automate
Deployment
9- Everyone can see what's happening
• Ensure the visibility of system state( builds pass/fail, for how long, what was added this
week).
• Use your own “good information display”.
• If using CI server 
• Hooking up a continues display to the build system (lava lamps example).
• If using manual CI 
• Use “BuildToken”
• Make simple noise on successful builds.
CI
Practices
Single
Source
Repository
Automate
the Build
Self-Testing
Build
Everyone
CommitsTo
the Mainline
Every Day
Build on an
Integration
Machine
Keep the
Build Fast
Test in a
Clone of the
Production
Easy to Get
the Latest
Executable
Everyone
can see
what's
happening
Automate
Deployment
10- Automate Deployment
• Why?
•CI needs multiple environments.(commit tests, secondary test).
•CI requires multiple deployments per day
• Benefits?
• Speed up process
• Reduce errors
10- Automate Deployment
• Should also consider “Automated Rollback”
 Reduce deployment tension
 Encourage frequent deployment
 Get new features out to users quickly
• Deployments Models (utilizing automated deployment):
• For clustered environments: one node per time, replacing the
application over few hours.
• For public web applications: deploy trial build for a subset of users.
CI
Practices
Single
Source
Repository
Automated
Build
Self-Testing
Build
Everyone
CommitsTo
the Mainline
Every Day
Build on an
Integration
Machine
Fast Build
Test in a
Clone of the
Production
Easy to Get
the Latest
Executable
Everyone
can see
what's
happening
Automated
Deployment
Benefits of Continuous Integration
Benefits of Continuous Integration
• Reduced risk.
• Completely eliminate the blind spot.
At all times you know where you are, what works, what doesn't, the outstanding bugs
you have in your system.
• Dramatically easier to find and remove bugs.
• Avoids the “BrokenWindow Syndrome” (cumulative bugs)
• Allows your users to get new features more rapidly, to give more rapid
feedback on those features, and generally become more collaborative in the
development cycle.
Introducing Continuous Integration
Introducing Continuous Integration
• No fixed recipe here - much depends on the nature of your setup and team.
• The essentials for any of the other things to work:
• Get everything you need into source control.
• Ability to build the whole system with a single command
• Nightly build is a fine step on the way.
• Introduce some automated testing into your build.
• Try to speed up the commit build.
So , will you give it a try?

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Jenkinsconf Presentation - Advance jenkins management with multiple projects.
Jenkinsconf Presentation - Advance jenkins management with multiple projects.Jenkinsconf Presentation - Advance jenkins management with multiple projects.
Jenkinsconf Presentation - Advance jenkins management with multiple projects.
 
DevOps, beyond agile
DevOps, beyond agileDevOps, beyond agile
DevOps, beyond agile
 
Continuous Integration as a Way of Life
Continuous Integration as a Way of LifeContinuous Integration as a Way of Life
Continuous Integration as a Way of Life
 
Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12
Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12
Continuous Development with Jenkins - Stephen Connolly at PuppetCamp Dublin '12
 
Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOps
 
Automated Build using teamcity
Automated Build using teamcityAutomated Build using teamcity
Automated Build using teamcity
 
At Your Service: Using Jenkins in Operations
At Your Service: Using Jenkins in OperationsAt Your Service: Using Jenkins in Operations
At Your Service: Using Jenkins in Operations
 
How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...
How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...
How Atlassian's Build Engineering Team Has Scaled to 150k Builds Per Month an...
 
Jenkins
JenkinsJenkins
Jenkins
 
Jenkins
JenkinsJenkins
Jenkins
 
CI/CD 101
CI/CD 101CI/CD 101
CI/CD 101
 
Standardizing Jenkins with CloudBees Jenkins Team
Standardizing Jenkins with CloudBees Jenkins TeamStandardizing Jenkins with CloudBees Jenkins Team
Standardizing Jenkins with CloudBees Jenkins Team
 
Smarter deployments with octopus deploy
Smarter deployments with octopus deploySmarter deployments with octopus deploy
Smarter deployments with octopus deploy
 
Continuous Delivery Using Jenkins
Continuous Delivery Using JenkinsContinuous Delivery Using Jenkins
Continuous Delivery Using Jenkins
 
Team City
Team CityTeam City
Team City
 
Contineous integration
Contineous integrationContineous integration
Contineous integration
 
10 Deployments a day - A brief on extreme release protocols
10 Deployments a day - A brief on extreme release protocols10 Deployments a day - A brief on extreme release protocols
10 Deployments a day - A brief on extreme release protocols
 
Continuous Deployment of your Application - SpringOne Tour Dallas
Continuous Deployment of your Application - SpringOne Tour DallasContinuous Deployment of your Application - SpringOne Tour Dallas
Continuous Deployment of your Application - SpringOne Tour Dallas
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
 

Ähnlich wie Continuous integration

Continuous Integration and Delivery
Continuous Integration and DeliveryContinuous Integration and Delivery
Continuous Integration and Delivery
Brandon Cornett
 
Continuous deployment steve povilaitis
Continuous deployment   steve povilaitisContinuous deployment   steve povilaitis
Continuous deployment steve povilaitis
Steve Povilaitis
 
AgileLINC Continous Slides by Daniel Harp
AgileLINC Continous Slides by Daniel HarpAgileLINC Continous Slides by Daniel Harp
AgileLINC Continous Slides by Daniel Harp
Barry Gavril
 
Buildbot introduction
Buildbot introductionBuildbot introduction
Buildbot introduction
williewu
 

Ähnlich wie Continuous integration (20)

Introduction to Continuous Integration
Introduction to Continuous IntegrationIntroduction to Continuous Integration
Introduction to Continuous Integration
 
Continuous integration (eng)
Continuous integration (eng)Continuous integration (eng)
Continuous integration (eng)
 
Continuous Integration and Delivery
Continuous Integration and DeliveryContinuous Integration and Delivery
Continuous Integration and Delivery
 
Introduction to Continuous Integration
Introduction to Continuous IntegrationIntroduction to Continuous Integration
Introduction to Continuous Integration
 
Enabling Agile Testing Through Continuous Integration Agile2009
Enabling Agile Testing Through Continuous Integration Agile2009Enabling Agile Testing Through Continuous Integration Agile2009
Enabling Agile Testing Through Continuous Integration Agile2009
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
Implementing Continuous Integration in .NET for Cheapskates
Implementing Continuous Integration in .NET for CheapskatesImplementing Continuous Integration in .NET for Cheapskates
Implementing Continuous Integration in .NET for Cheapskates
 
Continuous integration, delivery & deployment
Continuous integration,  delivery & deploymentContinuous integration,  delivery & deployment
Continuous integration, delivery & deployment
 
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
 
Continuous deployment steve povilaitis
Continuous deployment   steve povilaitisContinuous deployment   steve povilaitis
Continuous deployment steve povilaitis
 
Release Automation: Better Quality, Faster Deployment, Amazing ROI
Release Automation: Better Quality, Faster Deployment, Amazing ROIRelease Automation: Better Quality, Faster Deployment, Amazing ROI
Release Automation: Better Quality, Faster Deployment, Amazing ROI
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
AgileLINC Continous Slides by Daniel Harp
AgileLINC Continous Slides by Daniel HarpAgileLINC Continous Slides by Daniel Harp
AgileLINC Continous Slides by Daniel Harp
 
Adrian marinica continuous integration in the visual studio world
Adrian marinica   continuous integration in the visual studio worldAdrian marinica   continuous integration in the visual studio world
Adrian marinica continuous integration in the visual studio world
 
CI
CICI
CI
 
Buildbot introduction
Buildbot introductionBuildbot introduction
Buildbot introduction
 
Buildbot
BuildbotBuildbot
Buildbot
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
Jenkins_1679702972.pdf
Jenkins_1679702972.pdfJenkins_1679702972.pdf
Jenkins_1679702972.pdf
 
jenkins.pdf
jenkins.pdfjenkins.pdf
jenkins.pdf
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Continuous integration

  • 3. The common software story: Integration is a long and unpredictable process.
  • 4. But this need not be the way.. Integration can be a NON-Event !
  • 5. Contents • Building a Feature with Continuous Integration • Practices of Continuous Integration • Benefits of Continuous Integration • Introducing Continuous Integration
  • 6. Building a Feature with Continuous Integration
  • 7. Checkout the mainline Add the feature Local Build Committing: 1- Update working copy 2- Resolve conflicts if any 3- Repeat until synchronized with mainstream Build on Integration machine.
  • 9. CI Practices Single Source Repository Automated Build Self-Testing Build Everyone CommitsTo the Mainline Every Day Build on an Integration Machine Fast Build Test in a Clone of the Production Easy to Get the Latest Executable Everyone can see what's happening Automated Deployment
  • 10. CI Practices Single Source Repository Automate the Build Self-Testing Build Everyone CommitsTo the Mainline Every Day Build on an Integration Machine Keep the Build Fast Test in a Clone of the Production Easy to Get the Latest Executable Everyone can see what's happening Automate Deployment
  • 11. 1- Maintain a Single Source Repository • The Rule: “you should be able to do a checkout on a virgin machine and be able to fully build the System.” • The steps: • Get a decent source control management system. • Make sure it is the well known place for everyone to get the source. • Not only code. Put every thing you need to build. (test scripts, properties files,..). • Don’t overuse branches.
  • 12. CI Practices Single Source Repository Automate the Build Self-Testing Build Everyone CommitsTo the Mainline Every Day Build on an Integration Machine Keep the Build Fast Test in a Clone of the Production Easy to Get the Latest Executable Everyone can see what's happening Automate Deployment
  • 13. 2- AutomateThe Build • Turning sources into executable is often a complicated process, and since it can be automated, it Should be automated. • A good automated build script: • Every thing should be included(fetching DB scripts from repo and firing them). • Analyze what was changed and replace the needed classes only. • Should allow building different targets for different cases.
  • 14. CI Practices Single Source Repository Automate the Build Self-Testing Build Everyone CommitsTo the Mainline Every Day Build on an Integration Machine Keep the Build Fast Test in a Clone of the Production Easy to Get the Latest Executable Everyone can see what's happening Automate Deployment
  • 15. 3- MakeYour Build Self-Testing • XP andTDD popularized “Self-Testing Code” concept. • Self-Testing code: “The practice of writing comprehensive automated tests, in conjunction with functional software.”
  • 16. 3- MakeYour Build Self-Testing • To have Self-Testing code you need: • A suit of automated test with good coverage percent. • Be able to kickoff the tests with simple command. • The tests to be self checking. • To have Self-Testing Build: • Include the automated tests in the build process. • The failure of a test should cause the build failure.
  • 17. CI Practices Single Source Repository Automate the Build Self-Testing Build Everyone CommitsTo the Mainline Every Day Build on an Integration Machine KeepThe Build Fast Test in a Clone of the Production Easy to Get the Latest Executable Everyone can see what's happening Automate Deployment
  • 18. 4- Everyone CommitsTo the Mainline Every Day • Every developer should commit to the repository every day(at least). • Benefits: • The more frequent commits  less places to look for conflicts  more rapidly conflicts get fixed! (diff-debugging). • Encourage breaking down tasks into small chunks  easer to track progress.
  • 19. CI Practices Single Source Repository Automate the Build Self-Testing Build Everyone CommitsTo the Mainline Every Day Build on an Integration Machine Keep the Build Fast Test in a Clone of the Production Easy to Get the Latest Executable Everyone can see what's happening Automate Deployment
  • 20. 5- Every Commit Should Build the Mainline on an Integration Machine • Successful “local” builds is not enough. • You should a separate Integration machine to avoid developers machines environment differences issues. • You should not go home until you get a successful build on the integration machine. • Nightly builds are not enough for CI.(conflicts will stay undected for I day ) • Can be done in two ways: • Manually • Using Continues Integration server
  • 21. 5- Every Commit Should Build the Mainline on an Integration Machine • Manually: • Checkout the head of mainline. • Kickoff the build. • Keep an eye on it , until finish successfully.
  • 22. 5- Every Commit Should Build the Mainline on an Integration Machine • RememberTravis ? • The continues integration server should: • Monitor the Repository • Checks out the sources to the integration machine after each commit • Initiate a build • Send notification for the build status after completion.
  • 23. CI Practices Single Source Repository Automate the Build Self-Testing Build Everyone CommitsTo the Mainline Every Day Build on an Integration Machine Keep the Build Fast Test in a Clone of the Production Easy to Get the Latest Executable Everyone can see what's happening Automate Deployment
  • 24. 6- Keep the Build Fast • Every minute reduced of build time = a minute saved * per developer * per number of commits • What is considered a “Fast” build? • XP guidelines: 10 minutes build • The usual bottleneck :Testing • Specially tests that use services (like DB).
  • 25. 6- Keep the Build Fast • Use a “Deployment Pipeline” • Multiple builds done in sequence. • The commit triggers the first build “commit build” • Commit build should be fast  will use shortcuts(Test Double) • Shortcuts  reduce ability to detect bugs! • Should have balance between speed and bug finding • Then slower tests can start to run, and additional machines can be used. • Ensure that any large scale failure leads to new test added to the commit build. • Parallel secondary tests can be used to do more automated tests type(performance for example)
  • 26. CI Practices Single Source Repository Automate the Build Self-Testing Build Everyone CommitsTo the Mainline Every Day Build on an Integration Machine Keep the Build Fast Test in a Clone of the Production Easy to Get the Latest Executable Everyone can see what's happening Automate Deployment
  • 27. 7-Test in a Clone of the Production Environment • Set up test environment to be a mimic of production environment. (DB software version, OS version, libraries, IPs, ports ..) • Possible limitations: 1. Wide varieties (desktop applications) 2. Expensive • However, still try to duplicate the environment as much as you can. • Understand the risks you accept for every difference between test and production environment. • A growing option to overcome limitation: Virtualization
  • 28. CI Practices Single Source Repository Automate the Build Self-Testing Build Everyone CommitsTo the Mainline Every Day Build on an Integration Machine Keep the Build Fast Test in a Clone of the Production Easy to Get the Latest Executable Everyone can see what's happening Automate Deployment
  • 29. 8- Make it Easy for Anyone to Get the Latest Executable • Make sure there is a well known place where people can get latest executables. • Can be useful to put several executables. • Utilize the human behavior: “It is mush easier to adjust something visibly exist, than to specify how it should be in advance”
  • 30. CI Practices Single Source Repository Automate the Build Self-Testing Build Everyone CommitsTo the Mainline Every Day Build on an Integration Machine Keep the Build Fast Test in a Clone of the Production Easy to Get the Latest Executable Everyone can see what's happening Automate Deployment
  • 31. 9- Everyone can see what's happening • Ensure the visibility of system state( builds pass/fail, for how long, what was added this week). • Use your own “good information display”. • If using CI server  • Hooking up a continues display to the build system (lava lamps example). • If using manual CI  • Use “BuildToken” • Make simple noise on successful builds.
  • 32. CI Practices Single Source Repository Automate the Build Self-Testing Build Everyone CommitsTo the Mainline Every Day Build on an Integration Machine Keep the Build Fast Test in a Clone of the Production Easy to Get the Latest Executable Everyone can see what's happening Automate Deployment
  • 33. 10- Automate Deployment • Why? •CI needs multiple environments.(commit tests, secondary test). •CI requires multiple deployments per day • Benefits? • Speed up process • Reduce errors
  • 34. 10- Automate Deployment • Should also consider “Automated Rollback”  Reduce deployment tension  Encourage frequent deployment  Get new features out to users quickly • Deployments Models (utilizing automated deployment): • For clustered environments: one node per time, replacing the application over few hours. • For public web applications: deploy trial build for a subset of users.
  • 35. CI Practices Single Source Repository Automated Build Self-Testing Build Everyone CommitsTo the Mainline Every Day Build on an Integration Machine Fast Build Test in a Clone of the Production Easy to Get the Latest Executable Everyone can see what's happening Automated Deployment
  • 36. Benefits of Continuous Integration
  • 37. Benefits of Continuous Integration • Reduced risk. • Completely eliminate the blind spot. At all times you know where you are, what works, what doesn't, the outstanding bugs you have in your system. • Dramatically easier to find and remove bugs. • Avoids the “BrokenWindow Syndrome” (cumulative bugs) • Allows your users to get new features more rapidly, to give more rapid feedback on those features, and generally become more collaborative in the development cycle.
  • 39. Introducing Continuous Integration • No fixed recipe here - much depends on the nature of your setup and team. • The essentials for any of the other things to work: • Get everything you need into source control. • Ability to build the whole system with a single command • Nightly build is a fine step on the way. • Introduce some automated testing into your build. • Try to speed up the commit build.
  • 40. So , will you give it a try?