views:

31

answers:

2

Hi We have a .Net solution for a website, consisting of 5 projects, and there are a few(less than 10) developers working on the solution. We deploy almost on a daily basis. The question is, how to setup the SVN repo to support this scenario (the daily deploy), also mentioning that not every commited file should go to production, there is a QA check before deploying.

+2  A: 

What you want to do is commonly referred to as Continuous integration (CI).

While you can do that using Subversion, it is probably not the right tool for the job.

There is special CI software, which will allow you to easily automate the necessary tasks (checkout from version control, compiling / building, running automatic tests, deployment etc). An example would be CruiseControl.NET.

As to "not every commited file should go to production", the common solution is to have a special "release" branch, which gets deployed. Only tested code is merged there (or have the trunk always be stable, otherwise same model). Of course, you can also (better: additionally) have tests before your automatic deployment, and only deploy if all tests pass.

Working with a release branch

In practice, this means that people check in their code as they produce it. Sometimes this code will work, sometimes not. When the release time draws nearer, a "release branch" is created in Subversion. This release branch is then effectively a frozen snapshot of the source as it was at the time of branching. Now this branch can be used to compile & deploy the application, which can then be tested.

No new code is checked into the branch (but checkins can continue elsewhere). Only if a bug is detected in the branch, will there be a checkin into the branch to fix it. This continues until the branch passes all tests. Then the branch can be released as a new version of the software; afterwards the branch will only be used if the released version needs to be patched.

Of course, any bugfixes checked into the branch need to also be put into the trunk (either by merging branch -> trunk, for which Subversion provides special support, or by reimplementing the fix in the trunk, as appropriate).

sleske
Could you please elaborate more on how to commit only the right files to the release branch?
jaraics
Edited my answer. If you still have questions, feel free to ask a new question ;-).
sleske
+1  A: 

Try out TeamCity (CI tool) as its free for smaller amounts of CI. this may be better for you than CruiseControl.Net as CCNET is very configuration heavy as its all done via XML. TeamCity uses wizards to create the scripts to manage releases

if you need any other help on CI then let me know as its something I am evangelistic about.

PaulStack
TeamCity seems to be a nice tool, i'll try that out, thanks
jaraics
the use of NANT, MSBuild or Rake will help you develop release scripts that TeamCity can run and thus make a deployment package that includes only the files you want :)
PaulStack
Does TeamCity have a feature to notify the developer upon someone else commits to the SVN? Or to automatically update it's working-copy if the update is possible?
jaraics
there is a tray notifier that can alert you when a build is taking place and also if that build fails and you can see what changes were made to the code. if you need any help setting up Teamcity then you can mail me - paulstack [at] hotmail. [dot] com
PaulStack