Question

We have CC.NET setup on our ASP.NET app. When we build the project, the ASP.NET app is pre-compiled and copied to a network share, from which a server runs the application.

The server is a bit different from development box'es, and the next server in our staging environment differs even more. The difference is specific config files and so on - so I want to exclude some files - or delete them before the pre-compiled app is copied to a network share.

My config file looks like this:

    <project name="Assembly.Web.project">
    <triggers>
        <intervalTrigger seconds="3600" />
    </triggers>
    <sourcecontrol type="svn">
        <trunkUrl>svn://svn-server/MyApp/Web/Trunk</trunkUrl>
        <workingDirectory>C:\build-server\Assembly\Web\TEST-HL</workingDirectory>
    <executable>C:\Program Files (x86)\SVN 1.5 bin\svn.exe</executable>
    <username>uid</username>
    <password>pwd</password>
    </sourcecontrol>
    <tasks>
        <msbuild>
          <executable>C:\Windows\Microsoft.NET\Framework64\v3.5\MSBuild.exe</executable>
          <workingDirectory>C:\build-server\Assembly\Web\TEST-HL</workingDirectory>
          <projectFile>C:\build-server\Assembly\Web\TEST-HL\Web\Web.sln</projectFile>
          <buildArgs>/noconsolelogger /p:Configuration=Debug /v:diag</buildArgs>
          <targets>Build</targets>
          <timeout>900</timeout>
          <logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
        </msbuild>
    </tasks>
    <publishers>
        <buildpublisher>
             <sourceDir>C:\build-server\Assembly\Web\PrecompiledWeb</sourceDir>
             <publishDir>\\test-web01\Web</publishDir>
             <useLabelSubDirectory>false</useLabelSubDirectory>
             <alwaysPublish>false</alwaysPublish>
        </buildpublisher>           
    </publishers>
</project>

As you can see, I use a buildPublisher to copy the pre-compiled files to the network share. What I want to do here, is either 1) delete certain files before they are copied or 2) replace those files after they have been copied.

I DO NOT want to have some app running watching specific files for change, and then after that replace the files with other ones. I want something to be either done by CC.NET, or triggered by CC.NET.

Can you launch a .bat file with CC.NET?

Was it helpful?

Solution

You have to use NAnt for those kind of stuff. Here is the Task Reference of Nant..

OTHER TIPS

I use a NAnt task for all publishing, deploying, cleaning and so on.

Take a look at MSDEPLOY or Web Deployment Projects. There is a question that will provide more detail here

Of course CruiseControl.NET can run a batch file, simply use the exec task. However, an easier answer might just be to have MSBuild do the task for you. It should be simple to add a few steps in the postcompile target.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top