17. 1
2
3
4
5
6
7
Clean up previous builds
• Decide whether you build from scratch
• prevents unexpected behavior
• rebuilds everything, every time
• will make the build take longer to complete
8
18. 1
2
3
4
5
6
7
8
Get latest version
• Include everything
• Source code
• Libraries
• Database schema
• Build needs to be able to run on clean machine
19. 1
2
3
4
5
6
Increase version number
• Include version number in assemblies
• Decide whether you
• Increase all assemblies
• Increase only updated assemblies
7
8
20. 1
2
3
4
5
6
7
8
Build & deploy database
• Create a new & fresh database
• Visual Studio DataDude
• Comes free now with developer edition
• Deploy test data for integration tests
• Usually takes a long time
• Option to do this only in nightly build
• Creating a large change script is a different story
21. 1
2
3
4
5
6
7
8
Build the project
• Don’t build using an IDE like Visual Studio
• Rather use MSBuild, TeamBuild or a 3rd party lib.
• Don’t forget to automate
• Help files & documentation
• Installation files (setup.exe)
• Release notes
22. 1
2
3
4
5
6
7
8
Run tests
• Compiling code doesn’t prove it works
• Unit tests do
• Although they’re no 100% safety net
• Run unittests continuously
• Integration tests only at night
• Try web tests and new Visual Studio 2010 abilities
23. 1
2
3
4
5
6
7
8
Create deployment packages
• Create at least two deployment packages
• Make the build available to everyone
• Deploy websites to test server
• Deploy ClickOnce applications to test server
• Make iteration/milestone versions available
• Try to make automated rollback available
24. 1
2
3
4
5
6
7
Don’t leave the build broken overnight
• Make sure you’re developing on a stable base
• Builds can break, but…
• not too often
• not during the night
8
27. Team Foundation Server
Has everything you need
• Source control
• Data collection
• Reporting
• Project tracking
• For collaborative development
• Supports CI since version 2008
28. MSBuild
Complex XML script based on
targets and tasks.
Requires additional open source
tasks for completeness.
TeamBuild
This is where Team Foundation
Server runs on. It’s MSBuild with
TFS integration.
29. FinalBuilder
Unified graphical
interface to author and
execute builds with
650+ actions to execute.
Integration with TFS
FinalBuilder Server
Continuous integration
server to accompany
FinalBuilder.
32. Development process
1.
2.
3.
4.
5.
6.
7.
8.
Get latest version of integrated code
Add or change a feature
Build code & run tests locally
Get latest version & merge
Build code & run tests locally
Check-in source code
Verify automated build succeeds
Goto 1
34. Some best practices
•
•
•
•
Setup a build a.s.a.p!
Check-in as often as you can
Use a RAM disk to speed up the build
Use a Continuous Integration Token
36. Benefits of CI
• Reduced risk
• Confidence in frequent deployments
– New features more rapidly
– Better feedback on those features
• Better customer relations
• Improved team morale
Project with Db schema updates & sprocsIcon explanationClock : Build during the night, unattendedPackage : Create packages for test-, acceptance- and production environmentsDocument & Pen : Do so by, for example, changing configuration of connectionstringFolder : And set configuration to right folder with resourcesCheck : Run your unit tests automatedDatabase : And prepare database for integration tests and perhaps acceptance dataLightning : Make sure the build is fastFolder 2 : Put the stuff you create in some folder others can access, if necessary.Scroll : Create historical logsEnvelope : And email the build log of something went wrong
Top ones are paid, bottomones are free… Jedi is just in therebecause of the cool name!
Everything must go in the repository, becauseyouneed to beable to getonto a clean machine, get the latestversion and beable to compile.Of coursethere are limits. Complex installsdon’tneed to be, likean OS orotherlibrariesthatneedinstallation, likeTypemock Isolator
What if…You checked out ClassA and ClassB and are happily editing it.So you want ClassC, but unfortunately, DeveloperB already edited it and checked his (or her) version in.You check out ClassC anyhow, also do a GetLatestVersionOnCheckout, only to find out, DeveloperB also changed something to ClassD that your ClassC suddenly depends on.Well well, sucks, but we’ll also get ClassD then…Woah! Just found out, we also need some class called ClassE! It was also added in the same changeset. Okay, let’s do so…This getting worse, DeveloperB was doing a lot of work and created a shit load of extra files. Let’s get them all…Oh oh, now we’re scr*wed. Our ClassE also depends on some change in ClassB… Now we have to start merging our own ClassA because of the changes.Solution?Either turn of multiple-check-out, which raises a bunch of other problems. Or stop using GetLatestVersionOnCheckout
Reduced risk:At all times you know where you are, what works, what doesn’t, bugs, etc.