beautiful builds - roy osherove at microsoft swit
DESCRIPTION
more info at http://BeautifulBuilds.com Roy Osherove speaks at Microsoft SWIT conference in Ukraine about build patterns, build tools, continuous integration, continuous delivery, and how to make it all work.TRANSCRIPT
![Page 1: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/1.jpg)
BeautifulBuilds
@RoyOsheroveBouvet
![Page 2: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/2.jpg)
@RoyOsherove
Bouvet
![Page 3: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/3.jpg)
Release Compilation
![Page 4: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/4.jpg)
Why do we have builds?
• Code Compilation• Functionality Compilation• Deployment Compilation• Feedback
![Page 5: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/5.jpg)
Builds and tests are made to be broken
![Page 6: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/6.jpg)
What’s beautiful?
• See flow• Ease of change• Coherent
![Page 7: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/7.jpg)
Recommendations
• Use the right tools for build and CI• Use the right patterns to allow extra benefits
![Page 8: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/8.jpg)
Part of a Build Process
• Build Script/editor• Build Server / CI Server• Build Environments
![Page 9: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/9.jpg)
What’s the difference?
• Automated Build (what to do)• Continuous Integration (when to do it)
![Page 10: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/10.jpg)
Declarative• [Ant, nant,msbuild] (http://ant.apache.org/)• [Automake] (http://www.gnu.org/software/automake/)• [Boost Build] (http://www.boost.org/doc/tools/build/index.html)• [Cmake] (http://www.cmake.org/)• [Make] (http://www.gnu.org/software/make/)• [Ocamlbuild] (http://gallium.inria.fr/~pouillar/)• [Omake] (http://omake.metaprl.org/index.html)• [Qmake] (http://doc.trolltech.com/4.2/qmake-manual.html)• [Rake] (http://rake.rubyforge.org/)• [SCons] (http://www.scons.org/)• [Waf] (http://code.google.com/p/waf/)
![Page 11: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/11.jpg)
Xml Build Scripts (Ant) - declarative
![Page 12: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/12.jpg)
Procedural
• FinalBuilder• Visual build pro• Batch files• Powersell scripts
![Page 13: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/13.jpg)
Build Scripts (Bat)Procedural
![Page 14: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/14.jpg)
Domain Specific Language Build Scripts (Rake)
declarative
![Page 15: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/15.jpg)
Visual Build Scripts (FinalBuilder)
![Page 16: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/16.jpg)
Which one?
• Visual editing allows seeing FLOW• Easy to update and change by newbies• Easy to debug
• FinalBuilder or Visual Build Pro on windows• Rake on linux or mac
![Page 17: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/17.jpg)
The Right CI Tools
![Page 18: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/18.jpg)
TeamCity
![Page 19: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/19.jpg)
Jenkins
![Page 20: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/20.jpg)
CruiseControl
![Page 21: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/21.jpg)
Hudson
![Page 22: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/22.jpg)
Many others. Which one?
• TFS? TeamCity?• Support build agents• Support amazon ec2 auto scaling agents• Easy to setup and maintain• Free for a small team
• TeamCity is awesome
![Page 23: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/23.jpg)
But some CI servers support build actions too!
![Page 24: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/24.jpg)
Hardware
• Build Machine (with teamcity)– + agent machines (optional)
• Test Machine• Staging Machine• Production Machine
• This can all be in the cloud (EC2 is wonderful)
![Page 25: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/25.jpg)
Build Configurations
• Continuous Integration Build• Slow Build (nightly, optional)• Deploy to test servers• Deploy to staging servers (optional)• Deploy to production
![Page 26: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/26.jpg)
![Page 27: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/27.jpg)
Build Script Injection
• Allow version aware builds• Build scripts are part of source control• Build configurations on the CI server are dumb
triggers
![Page 28: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/28.jpg)
Fill In The Blanks
• Build Script uses placeholders for system related knowledge
• Placeholders are filled from environment variables or other types of parameters to the command line
• These variables are SET by the Build Configuration on the CI server
![Page 29: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/29.jpg)
![Page 30: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/30.jpg)
Location Agnostic Scripts
![Page 31: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/31.jpg)
Extract Script
![Page 32: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/32.jpg)
Build Chain Triggers
Triggered by checkin
Triggered by end of previous
Manual
Manual
![Page 33: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/33.jpg)
Slow Builds
Do X
Do X + Y
Do X + Y + Z
Do X + y + Z + N
![Page 34: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/34.jpg)
Cumulative, Fast Builds
Do X
Do Y
Do Z
Do N
![Page 35: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/35.jpg)
How Fast?
![Page 36: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/36.jpg)
Shipping Skeleton
• Start by releasing• Deploy a hello world empty skeleton• Then fill out the product• Continue adding small build features as you go
along
![Page 37: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/37.jpg)
More info beautifulbuilds.com
![Page 38: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/38.jpg)
Short Song?
![Page 39: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/39.jpg)
This is a test line
![Page 40: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/40.jpg)
It looks like you’re doing just fine
![Page 41: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/41.jpg)
The was a bomb in the kiev airline
![Page 42: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/42.jpg)
The build song
Why this song?
![Page 43: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/43.jpg)
Every build you break
• Refactoring you make• Every mock you fake• You little snake
• I’ll be watching you
![Page 44: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/44.jpg)
• Every stand up meeting• I believe you’re cheating• Every unit test• Pains my chest
• I’ll be stopping you
![Page 45: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/45.jpg)
• Oh can’t you see?• This is scaring me• Every time we deliver• I begin to shiver
![Page 46: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/46.jpg)
• When you say “transparent”• My fear is apparent• ‘Hide reality’• Is my mentality• I’ll be stopping you
![Page 47: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/47.jpg)
• Oh can’t you see• I would rather ski• Dealing with this change• Is gonna feel so strange
![Page 48: Beautiful Builds - Roy Osherove at Microsoft Swit](https://reader033.vdocuments.net/reader033/viewer/2022061217/54b520904a7959711c8b458f/html5/thumbnails/48.jpg)
• Every build you break…