Your SlideShare is downloading. ×
Leveraging Continuous Integration For Fun And Profit!
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Leveraging Continuous Integration For Fun And Profit!

3,262
views

Published on

This is an introduction to the concepts of Continuous Integration (with a little bit of Agile/XP thrown in for good measure).

This is an introduction to the concepts of Continuous Integration (with a little bit of Agile/XP thrown in for good measure).

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
3,262
On Slideshare
0
From Embeds
0
Number of Embeds
38
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Avoid “Build on my machine” syndromeMetrics = coverage, complexity, coherence, couplingConformance = Styles, FxCop
  • Checkin often = average every 15 min to 30 minGood guide on when to stop = Unit test is green
  • Transcript

    • 1. Leveraging Continuous Integration for Fun and Profit!
      Jess Chadwick
      Independent Consultant
      http://blog.jesschadwick.com
    • 2. Agenda
      What is Continuous Integration?
      How does it fit in to the Agile lifecycle?
      How do I implement it?
      Best Practices
    • 3. What is Continuous Integration?
      Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including tests) to detect integration errors as quickly as possible.
      Many teams find that this approach leads to significantly reduced integration problemsand allows a team to develop software more rapidly.
      Martin Fowler, September 2000
    • 4. Layers of Quality Assurance
    • 5. Continuous Integration in XP
    • 6. Benefits of Continuous Integration
    • 7. Exponentially Building Value
    • 8. Components
    • 9. CI Servers
    • 10. Covert Operation
      Can’t get your team to buy in?
      Run it on your own box!
    • 11. Build Scripts – NAnt
      <?xml version="1.0"?>
      <project name="Hello World" default="build" basedir=".">
      <description>The Hello World of build files.</description>
      <property name="debug" value="true" overwrite="false" />
      <target name="clean" description="remove all generated files">
      <delete file="HelloWorld.exe" failonerror="false" />
      <delete file="HelloWorld.pdb" failonerror="false" />
      </target>
      <target name="build" description="compiles the source code">
      <csc target="exe" output="HelloWorld.exe" debug="${debug}">
      <sources>
      <includes name="HelloWorld.cs" />
      </sources>
      </csc>
      </target>
      </project>
    • 12. Build Scripts – MSBuild
      <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
      <OutputPath>.in</OutputPath>
      </PropertyGroup>
      <Target Name="FooCompilation">
      <MakeDir Directories= "$(OutputPath)"/>
      <Copy SourceFiles="Image.jpg"
      DestinationFiles="$(OutputPath)Image.jpg"/>
      <Csc Sources="Foo2.cs" TargetType="module"
      OutputAssembly="$(OutputPath)Foo2.netmodule" />
      <Csc Sources="Foo1.cs" TargetType="exe"
      AddModules="$(OutputPath)Foo2.netmodule"
      LinkResources="Image.jpg"
      OutputAssembly="$(OutputPath)Foo1.exe" />
      </Target>
      </Project>
    • 13. Build Scripts – psake
      properties {
      $testMessage = 'Executed Test!'
      $compileMessage = 'Executed Compile!'
      $cleanMessage = 'Executed Clean!'
      }
      task default -depends Test
      task Test -depends Compile, Clean {
      Write-Host $testMessage
      }
      task Compile -depends Clean {
      Write-Host $compileMessage
      }
      task Clean {
      Write-Host $cleanMessage
      }
    • 14. Build Scripts – rake
      #!/usr/bin/env ruby
      require 'ftools'
      def make_directories
      File.makedirs "html"
      File.makedirs "html/images"
      End
      def generate_html
      system %{./runwpbrake.wpb}
      end
      def build
      make_directories
      generate_html
      end
      build
    • 15. DEMOLet’s see it in action!
    • 16. Notifications
    • 17. Notifications – Lava Lamps
      http://agileworks.blogspot.com/2009/02/lava-lamp-with-cruisecontrol.html
    • 18. Notifications – iPhone app
      Yeah – there’s an app for that.
    • 19. Notifications – Brian the Build Bunny
      Brian Woodward: http://www.woodwardweb.com/gadgets/000434.html
    • 20. Best Practices
      Build must be green at the end of the day
      Never check in code and leave office (ninja commit)
      Stay and fix the code OR revert the check in
      Check in often
      Less chance of merge conflict
      Always have the latest code
      Never check in or check out of a broken build
    • 21. Best Practices – cont’d
      Communicate
      Be informed. Keep up-to-date with build status
      If you broke the build, tell the team
      Merge conflict? Talk to - don’temail - the other team member(s)
      Be familiar with the build process
      Don’t have to be the ‘build master’ but need to know how to troubleshoot and fix
    • 22. Various Build Types
      Continuous: Run on every commit (give or take)
      Lean & Fast
      Very basic validation
      Timed: Hourly, Nightly, etc.
      Longer
      More in-depth
      Deployment
      Utility
      Much like scheduled tasks
      For ease of use
    • 23. But there’s more!
      Post-Build
      Database upgrade
      Code analysis (coverage, quality metrics, compliance)
      Packaging
      Deployment
    • 24. Continuous Deployment
      Shrink the ‘Last Mile’ (QA, UAT, Production)
      Reduce risk
      Exercise deployment process early
      Software always ready for deployment
    • 25. Discussion Time
      Viewpoints
      Experiences & Tips
      Values
      http://blog.jesschadwick.com
      Twitter: jchadwick
      jchadwick@gmail.com