Pages

Thursday, July 08, 2010

Packaging Web Sites through CI

Currently looking for a task that will execute an equivalent of "Build Deployment Package", but from a command line. This should be available as an MSBuild task.
So far I'm having more luck finding instructions on how to do the same for Web Site, rather than Application...

Continuous integration with Team City and MSBuild

The following article - (link) -  contains the command line that executes what I want. It is fairly easy:
MSBuild MvcApplication1.csproj /T:Package
There's a good reference for command-line parameters for MSBuild here.
A useful article: Web Packaging:Creating web packages using MSBuild (link).

Using the MSDN reference (link), I tried adding
MSBuild Targets="Package"
task to the AfterBuild target in .csproj file but that did not work, creating a circular reference.
This MSDN page shows how to override default targets (link).

The batch file that does the job right contains only:
msbuild MvcApplication1.csproj /target:package /p:Configuration=Debug
This StackOverflow question (link) contains a sample MSBuild configuration.

So, the solution I'm currently happy with is to use a custom MSBuild configuration file and call the project targets from that.

*********************************************************************
After making breakthrough I updated my Deployment page (link).

No comments: