views:

58

answers:

2

Hi there, I have a project in CruiseControl.net that I am trying to create a schedule for it to run at a certain time most days.

The problem is that it doesn't work. The scheduled time does not update in the CCnet dashboard it seems until i remove the project trigger. Then it works..but it's not building a project so therefore useless.

In my CCnet.config:

  <project>
    <name>MyProject-nightly</name>

      <triggers>  
        <multiTrigger operator="And"> 
            <triggers> 
                <projectTrigger project="MyProject" /> 
                <scheduleTrigger time="11:23" buildCondition="ForceBuild">
                    <weekDays>
                        <weekDay>Monday</weekDay>
                        <weekDay>Tuesday</weekDay>
                        <weekDay>Wednesday</weekDay>
                        <weekDay>Thursday</weekDay>
                        <weekDay>Friday</weekDay>
                        <weekDay>Saturday</weekDay>
                    </weekDays>
                </scheduleTrigger>
            </triggers> 
        </multiTrigger>
    </triggers>

  </project>

When I remove this line:

<projectTrigger project="MyProject" />

the next build time in the Dashboard updates correctly, and it does execute at that time that is specified but nothing happens obviously.

What is wrong with this? I am using CruiseControl.net version: 1.5.7256.1

A: 

I did find a different way to achieve this by simply not making a separate project and putting this in the one project:

<triggers> 
    <multiTrigger operator="And"> 
        <triggers>
        <intervalTrigger name="Continuous Integration" seconds="5" buildCondition="IfModificationExists" initialSeconds="30" />
            <scheduleTrigger time="20:00" buildCondition="ForceBuild">
                <weekDays>
                    <weekDay>Saturday</weekDay>
                </weekDays>
            </scheduleTrigger>
        </triggers> 
    </multiTrigger>
</triggers>

This gives both a scheduled build of the code on Saturday night at 8:00PM and will build if the source code changes.

Hopefully this can help someone else trying to achieve the same thing.

Brock Woolf
+1  A: 

You don't have to create a different project.I think you misunderstand the ProjectTrigger too, ProjectTrigger is to start the build if another project has finished building (in your case it would start building MyProject-nightly when MyProject finished building, which I don't think is what you want).

What exactly is the behaviour you want?

If you want your project to build from source control modification and nighly you have to configure like this :

<triggers> 
    <intervalTrigger name="Polling From source control" seconds="60" BuildCondition="IfModificationExists"/>
    <scheduleTrigger time="23:30" buildCondition="ForceBuild" name="Nighly Build">
        <weekDay>Monday</weekDay>
        <weekDay>Tuesday</weekDay>
        <weekDay>Wednesday</weekDay>
        <weekDay>Thursday</weekDay>
        <weekDay>Friday</weekDay>
        <weekDay>Saturday</weekDay>
    </scheduleTrigger>
</triggers> 

which is strictly equivalent to a multitrigger with a OR operator.

Benjamin Baumann