How to use continuous integration for asp.net projects
How i use continuous integration server for automatic & faster delivery of .net projects
What you need :
1> Go (Cruise) continuous integration server
2> Go Agents - these are programs that actually run your tasks
3> SVN - Version control system
4> NUNIT - Unit testing framework
5> NANT - Build scripts for Deployments
Set up Visual Studio projects using TreeSurgeon. It nicely lays out basic structure for you which can further expanded. I try to keep Business logic, web app in separate sub projects - just to make life easier.
It usually looks like this
- /build —> used for holding build files or any other tmp files
- /configs —> configuration files
- /docs
- /libs —> globally used libraries
- /sql —> db scripts & schema’s
- /src —> main visual studio project source code
- /tools —>nant , nunit files
- go.bat —> batch file that starts build scripts via command line (@tools\nant\NAnt.exe -buildfile:web.build %*)
- web.build —> nant build file
Everything is stored in subversion. But any thing that can be generated using compiling stays out i.e. web project dll’s , bin folder , obj folder etc.
As soon as project is checked in. Go server + Go agents starts downloading latest /trunk of project and start executing build file using following command
<stage name=”qa”>
<jobs>
<job name=”deploy”>
<resources>
<resource>windows</resource>
</resources>
<tasks>
<exec command=”go.bat qa” />
</tasks>
</job>
</jobs>
</stage>
This simply starts go.bat file with name of environment i.e. qa . Based on environment name build script picks up correct versions of configuration file (QA , staging , live).It also runs unit tests.
If all unit testes are passed then it would deploy asp.net project in designated directory on web servers directories along with correct version of QA configuration files.
What do you think about this process?
Drop me a mail.