views:

649

answers:

2

I use SourceGear Vault and applyLabel="true" for a project so when it builds it will create a label in SourceGear Vault for the corresponding project.My questions are

I have a nightly builds so what if i don't have any changes made to that project for that day then how do I define my settings....

 <sourcecontrol type="vault" autoGetSource="true" applyLabel="true">
           <executable>c:\program files\sourcegear\vault client\vault.exe</executable>
           <username>john</username>
            <password>password</password>
            <host>server</host>
            <repository>Default Repository</repository>   
            <folder>$/Projects/xxx/xxx/xxx/source/xxx/xxx/xxx/xx.source</folder>
           <ssl>false</ssl>
           <timeout units="minutes">10</timeout>
           **<useWorkingDirectory>false</useWorkingDirectory>**
           <workingDirectory>C:\CCNET\build\xx\xx\</workingDirectory>
     </sourcecontrol>

The thing is that I don't want labels for build where there are no changes to code.

Any help is appreciated.

+1  A: 

In your project definition there should be a <triggers> section. For our nightly builds we use the following:

   <triggers>
      <scheduleTrigger time="00:30" buildCondition="IfModificationExists"/>
   </triggers>

This tells CCNet to build at 0030 hours only if changes have been checked in since the last build. The important part here is the buildCondition="IfModificationExists", which can be used on any trigger type.

Scott Dorman
A: 

So scott you mean you have different definitions for nightly and normal builds or different triggers?

This should have been a comment to my post, but...yes. We have different build definitions for nightly and CI builds which build out of different directories on the same build server. They also use different triggers as the CI definition uses an intervalTrigger.
Scott Dorman