R – CruiseControl.NET Build Label & SourceGear Vault Practice Related Question

buildcruisecontrol.netlabel

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.

Best Answer

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.

Related Topic