Continuous Integration &
Continuous Delivery
Denis Ristic
Or,
how to build software
better, faster, cheaper
Who am I?
@denisristic
denis.ristic@perpetuum.hr
● Software architect
● Developer
● Team Leader
● Scrum Master
● DevOps engineer
CI Definition
CI is the practice in software
engineering of merging all working
copies with a shared mainline several
times a day
[Wikipedia]
What is CI?
● a development methodology
● of daily developer integrations
● verified by automated builds
What is not CI?
● nightly builds
● dev branches
● building via IDEs
Building software
can be a risky
business
● Fixing bugs late is costly
● Lack of team cohesion
● Poor quality code base
● Lack of project visibility
● Lack of deployable software
How CI works?
Better
● Build better quality software
● That is tested early and often
● Using best practices and
coding standards
Faster
● Test in parallel, not at the end
● No integration points
● Builds become a non event
Cheaper
● Identify defects earlier
● Fix when least costly
● Easy repetable testing
CD Definition
CD is a software engineering
approach in which teams produce
software in short cycles, ensuring that
the software can be reliably released
at any time
[Wikipedia]
CD Ingredients
● Compilation
● Tests execution
● Database integration
● Code inspection
● Automated deployment (!!!)
● Documentation generation
Compilation
● Ensure code actually compiles
● On every target platform
Test Execution
● Ensures product functions as expected
● Through repeatable testing
Database Integration
● Ensures that DB and code are in sync
● Automates (re)creation of DB and test data
Code Inspections
● Ensures a healthy code base
● Identifies problems early
● Enforces best practices
Automated Deployment
● Products can be released anytime
● Continually demo-able state
● Eliminates “works on my machine”
Document Generation
● Ensures documentation is current
● Removes burden from developers
● Products build reports and metrics
How do I get started?
When do I build?
● At every check-in
● Every time a dependency changes
How do I build?
● Use a single build script
● That can run from console
● Do not depend on an IDE
How to do it continuously?
● Use a dedicated CI server, not cron
● Trigger on all daily check-ins
● Not (only) at midnight
Pay attention to your builds
● Provide immediate feedback
● Make it easily accessible
● Require no developer effort
Metrics Matter
● Identify key metrics and track them visually
● Act on them immediately
Cookbook
7 steps
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
Summary
Continuous Integration
Can help you build better quality
software faster, with
more confidence
The End

Continuous integration & Continuous Delivery @DeVz

  • 1.
  • 2.
    Or, how to buildsoftware better, faster, cheaper
  • 3.
    Who am I? @denisristic denis.ristic@perpetuum.hr ●Software architect ● Developer ● Team Leader ● Scrum Master ● DevOps engineer
  • 4.
    CI Definition CI isthe practice in software engineering of merging all working copies with a shared mainline several times a day [Wikipedia]
  • 5.
    What is CI? ●a development methodology ● of daily developer integrations ● verified by automated builds
  • 6.
    What is notCI? ● nightly builds ● dev branches ● building via IDEs
  • 7.
    Building software can bea risky business ● Fixing bugs late is costly ● Lack of team cohesion ● Poor quality code base ● Lack of project visibility ● Lack of deployable software
  • 8.
    How CI works? Better ●Build better quality software ● That is tested early and often ● Using best practices and coding standards Faster ● Test in parallel, not at the end ● No integration points ● Builds become a non event Cheaper ● Identify defects earlier ● Fix when least costly ● Easy repetable testing
  • 9.
    CD Definition CD isa software engineering approach in which teams produce software in short cycles, ensuring that the software can be reliably released at any time [Wikipedia]
  • 10.
    CD Ingredients ● Compilation ●Tests execution ● Database integration ● Code inspection ● Automated deployment (!!!) ● Documentation generation
  • 11.
    Compilation ● Ensure codeactually compiles ● On every target platform
  • 12.
    Test Execution ● Ensuresproduct functions as expected ● Through repeatable testing
  • 13.
    Database Integration ● Ensuresthat DB and code are in sync ● Automates (re)creation of DB and test data
  • 14.
    Code Inspections ● Ensuresa healthy code base ● Identifies problems early ● Enforces best practices
  • 15.
    Automated Deployment ● Productscan be released anytime ● Continually demo-able state ● Eliminates “works on my machine”
  • 16.
    Document Generation ● Ensuresdocumentation is current ● Removes burden from developers ● Products build reports and metrics
  • 17.
    How do Iget started?
  • 18.
    When do Ibuild? ● At every check-in ● Every time a dependency changes
  • 19.
    How do Ibuild? ● Use a single build script ● That can run from console ● Do not depend on an IDE
  • 20.
    How to doit continuously? ● Use a dedicated CI server, not cron ● Trigger on all daily check-ins ● Not (only) at midnight
  • 21.
    Pay attention toyour builds ● Provide immediate feedback ● Make it easily accessible ● Require no developer effort
  • 22.
    Metrics Matter ● Identifykey metrics and track them visually ● Act on them immediately
  • 23.
  • 24.
    7 steps 1. Commitearly, 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
  • 25.
  • 26.
    Continuous Integration Can helpyou build better quality software faster, with more confidence
  • 27.