How do I deploy/publish a Web Application with CruiseControl.NET & MSBuild? I am new to CCNET and I able to get it to get the latest source from SVN and Build with MSBuild 3.5. How do I get the site to publish to another (DEVELOPMENT) server? Thanks for any pointers/examples.
Cheers, ~ck
To deploy your web application, select your web application from Solution Explorer and right-click on your web application and click on the Publish button. At the next screen, click on Web Server (IIS) and click Next button. Select Web Deploy to publish your code and click Next.
For publishing web sites to a development server after it is build on my CI server in CruiseControl.NET, I use Microsoft Web Deploy. It requires that you install the deployment service on any servers that will be deployment targets. Then you can simply add an execute step to your build process that runs msdeploy.exe. Here is an example I use in NAnt:
<exec program="C:\Program Files\IIS\Microsoft Web Deploy V2\msdeploy.exe">
<arg value="-verb:sync"/>
<arg value="-source:dirPath="${tmpdir}""/>
<arg value="-dest:dirPath="${deploy.dir}",computerName=http://${servername}/msdeploymentservice/"/>
</exec>
By using Web Deploy, you can easily do a complete sync of the web site contents removing things that should not be there as well. It also has other options to do things like ignore certain directories and issue commands to recycle app pools, etc.
My solution for CCNET with the Web.config transformation:
<tasks>
<msbuild>
<executable>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
<workingDirectory>E:\VersionesCC\Trunk_4\SBatz\Gertakariak_Orokorrak\GertakariakMS\Web</workingDirectory>
<projectFile>GertakariakMSWeb2.vbproj</projectFile>
<targets>Build</targets>
<timeout>600</timeout>
<logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MSBuild.dll</logger>
<buildArgs>
/noconsolelogger /p:Configuration=Release /v:diag
/p:DeployOnBuild=true
/p:AutoParameterizationWebConfigConnectionStrings=false
/p:DeployTarget=Package
/p:_PackageTempDir=E:\Aplicaciones\GertakariakMS2\Web
</buildArgs>
</msbuild>
</tasks>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With