Creating Builds
July 19, 2011 Leave a comment
This is the second post discussing creating an automated build structure. After selecting CC.NET for our build infrastructure due to cost, stability and personal knowledge, I need to determine which builds I am going to create to begin the process of having a more streamlined build process. While Continuous Integration hardliners may not agree, I created two builds: a Commit Build and a Release build.
Commit Build:
The commit build is executed every time a developer checks into source control for the project. The purpose of this build is to ensure that the check-in compiles and any automated tests execute successfully. This build should run in less than five minutes so the developer can retrieve feedback from their check in as soon as possible. The build rebuilds the solution using the debug configuration, updates the assembly version with a debug assembly version but, does not copy assemblies to a directory for consumption. Therefore, the output of the commit build will never be used and this build is only used for commit verification.
Release Build:
The release build is executed each evening at 11:30 PM as well as on demand by anyone on the team. The purpose of this build is to create a output which will be tested and potentially released by the team. While this build should run under 10 minutes there is less of a time constraint on this build except for the fact that, if this is running during the day, developers should not check in while it is retrieving the source to limit the chances of the build pulling half a check. The release build builds in release mode, updates the assembly version with the the build number, copies the output to a share drive and obfuscates the code. Ideally, the release build will also build the installer, but to do this the installer would need to support build to build migration instead of merely release to release migration which it does now. Therefore, the output is a releasable.
As I stated above some may cringe that I have created two builds and believe every check in should create a testable or releasable output. The reason I did not go down this path was due to the excess of builds. Copying each commit build to a server which is backed up will clutter our server with builds which will never be used. While storage is cheap, there is no reason to waste it with unused output. Instead, achieve the benefits of near instant feedback with a Commit Build and enable the team to create releasable builds in an ad-hoc fashion with a Release Build.
My team supports many different applications and as we move forward we will be creating a Commit and Release build for each supported branch of each supported application.
In the next post on this subject I am going to discuss how I structured my NANT builds to share properties and targets and decrease modifications to the ccnet.config file.