Saturday, August 13, 2011

Configure a basic build server

Automation is power in software development
the exact name is continuous integration
i want to be able in one click to get latest version, build, run test and publish
this click makes me feel that i have a control on my project
in this post i'll show a basic configuration of build server
that includes:

  1. Get latest version form your source control

  2. Build your project

  3. Run your automatic testing

  4. Send an email notification with the status of the project (failed/success)


to this configuration we just have to add build trigger (schedule, on check in,...)
we also have to add an email notification to get status of the project to my email inbox


note: to run this sample you have to include your project and your test project in the same solution
you may see a sample project exactly in this structure here

my build server software is TeamCity
the build server configuration is very easy and includes 4 steps:


step 1:
-------

General Settings: nothing special in the first step, just supply a name for your project
Sample_step1


step 2:
-------

Version Control Settings: create and attach a new VCS root,
add checkout rule with the value of +:. (include all files)
and set your checkout directory (your local directory)
Sample_step2


step 3:
-------

Choose your build runner: this step inculde two sub-steps,
choose a build runner and set your test project location
the simplest runner is visual studio solution,
set your solution file and set your target and configuration fields

to set your test project you have to check the check box of run MSTest
set the path to MSTest.exe and set the path to your project test file under
List assembly files field
Sample_step3


step 4:
-------

Build Triggering: choose your build triggering,
i use a nightly scheduled build
Sample_step4


that's all now you have a build server!
just set your email notification in the project settings
a future work will be project publish with web config transforms
i hope i won't be too lazy and publish a post on it