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

5

6

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

Nussbaum answered 19/8, 2009 at 3:35 Comment(0)
F
2

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.

Federate answered 28/1, 2013 at 23:7 Comment(0)
S
2

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>
Scotfree answered 8/5, 2013 at 8:33 Comment(0)
C
0

I typically use the Build Publisher task to deploy files onto remote servers. You could also write a script with an xcopy command to deploy as well.

Companionway answered 19/8, 2009 at 12:10 Comment(0)
L
0

You can use Web Deployment Projects to help with this as well. In the WDP you can use the ExcludeFromBuild item to exclude those files. For more info see http://msdn.microsoft.com/en-us/library/aa479568.aspx.

This would handle the site to get pre-compiled for you to then publish to another dev server, this depends on how you deploy now. If you copy to network share or ftp then you can do those with MSBuild as well. I'm not familiar with the Build Publisher that the previous answer mentions.

Longley answered 23/8, 2009 at 19:25 Comment(1)
what if you wanted to publish your web app (mvc) and you do not have visual studio installed on the server, how would you go about building and publishing?Sumac
K
0

I found this blog very useful. Essentially you point the ccnet.config file to a MSBuild.xml file that you create in your project directory. Within the MSBuild.xml file you create a target which will build and publish the web application using the _CopyWebApplication option

Kensell answered 16/2, 2011 at 15:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.