views:

742

answers:

3

I have a default nant build that runs on every checkin in CC.net. What I would like to do is on a nightly schedule run a different nant task under the same build that would do a clean checkout of the codebase for the next day.

Is this possible with cc.net? I've done it with TeamCity and I'm rusty with cc.net as I haven't used it in awhile.

A: 

Yes. You can create a new project in CruiseControl that runs your normal build or you can have it run a separate build (per your needs). Then schedule this project to run at a specific time (morning).

Try this: http://cruisecontrol.sourceforge.net/main/configxml.html

Or this: http://confluence.public.thoughtworks.org/display/CCNET/Schedule+Trigger

Andrew Siemer
I didn't want to create a completely seperate project for it. I want it under the same project that does the checkin builds
Sean Chambers
A: 

I think what you're looking for is setting up the triggers to a preset time. There is this settings. Example below from the CC.NET site.

    <scheduleTrigger time="23:30" buildCondition="ForceBuild" name="Scheduled">
       <weekDays>
           <weekDay>Monday</weekDay>
       </weekDays>
    </scheduleTrigger>

You can do a build when you want, if you didn't want to do the whole thing at once you could make projects with that trigger that focused on smaller aspects of your code. That is how you make CC.NET start a build at a given time.

More info on Schedule Triggers at confluence's site

Jared
I saw how to setup the triggers, but I'm not sure how I can target a specific nant task when a trigger executes. For instance, in my build file i have a target called "nightly-build" that I want to execute when the trigger is fired
Sean Chambers
+1  A: 

CruiseControl.Net will pass the build trigger condition to you NAnt script. So your build can invoke different targets based on property CCNetBuildCondition being set either to "IfModificationExists" or "ForceBuild".

skolima