Dashboard > CruiseControl > ConfiguringCruiseControl > DependentProjects
DependentProjects Log In | Sign Up   View a printable version of the current page.

Added by Allan Wick , last edited by Allan Wick on Jun 11, 2008  (view change)
Labels: 
(None)

Project Dependencies

This scenario covers the situation where Project A is dependent on code from Project B.

Simple build dependency

You will need to add a buildstatus element to the modificationset element inside Project A referencing Project B's log directory.

Trigger Project A if Project B has successful build
<project name="Project A">
   ...
   <modificationset>
     ...
     <buildstatus logdir="logs/Project B" />
   </modificationset>
   ...
 </project>

This will only trigger a build on Project A if there has been a successful build of Project B.

Adding change dependency

In order to NOT build Project A if Project B has some modifications, you need to use the veto element.

Cancel build for Project A if Project B has changes
<project name="Project A">
   ...
   <modificationset>
     ...
     <buildstatus logdir="logs/Project B" />

     <veto>
       <triggers>
         <cvs module="Project_A" ... />
       </triggers>
       <buildstatus logdir="logs/Project B" />
     </veto>
   </modificationset>
   ...
 </project>

 <project name="Project B">
   ...

   <modificationset>
     <cvs module="Project_B" ... />
   </modificationset>

   ...
 </project>

Multi-threaded server additions

Finally, if you also are running multiple threads, you don't want to have both ProjectA and ProjectB running at the same time. Here you use the lockfilebootstrapper and lockfilelistener to complete the full configuration.

Adding multiple thread locking
<project name="Project A">
   ...
   <modificationset>
     ...
     <buildstatus logdir="logs/Project B" />

     <veto>
       <triggers>
         <cvs module="Project_B" ... />
       </triggers>
       <buildstatus logdir="logs/Project B" />
     </veto>
   </modificationset>

   <listeners>
     <lockfilelistener projectname="${project.name}" lockfile="${lockfile.dir}/ProjectA_ProjectB.lock" />
   </listeners>

   <bootstrappers>
     <lockfilebootstrapper projectname="${project.name}" lockfile="${lockfile.dir}/ProjectA_ProjectB.lock" />
   </bootstrappers>
   ...
 </project>

 <project name="Project B">
   ...

   <modificationset>
     <cvs module="Project_B" ... />
   </modificationset>

   <listeners>
     <lockfilelistener projectname="${project.name}" lockfile="${lockfile.dir}/ProjectA_ProjectB.lock" />
   </listeners>

   <bootstrappers>
     <lockfilebootstrapper projectname="${project.name}" lockfile="${lockfile.dir}/ProjectA_ProjectB.lock" />
   </bootstrappers>
   ...
   ...
 </project>
Powered by a free Atlassian Confluence Open Source Project License granted to ThoughtWorks, Inc.. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7.1, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators