Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I deploy/publish a Web Application with CruiseControl.NET & MSBuild?

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

like image 276
Hcabnettek Avatar asked Aug 19 '09 03:08

Hcabnettek


People also ask

How do I deploy a Visual Studio web application?

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.


2 Answers

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=&quot;${tmpdir}&quot;"/>
        <arg value="-dest:dirPath=&quot;${deploy.dir}&quot;,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.

like image 139
ioscode Avatar answered Nov 14 '22 11:11

ioscode


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>
like image 44
Asier Avatar answered Nov 14 '22 10:11

Asier