This documentation relates to an earlier version of Bamboo.
View

Unknown macro: {spacejump}

or visit the current documentation home.

Sometimes you may want to trigger a build when another plan's build has successfully completed. This ensures that changes to one plan's code do not break a dependent build (known as a 'child' build).

たとえば、Bamboo に2つのプランがあるとします。

  1. 'ACME-CORE' — which contains the core code for an application.
  2. 'ACME-PLUGIN' — which contains code for a plugin to the application.

In this scenario, ACME-PLUGIN is a child of ACME-CORE. Any changes to the ACME-CORE code should trigger a build of Acme-PLUGIN. In turn, every time a build completes successfully for ACME-PLUGIN, you might want to then run builds for some additional plans (e.g 'ACME-FUNCTIONAL-TESTS' and 'ACME-UNIT-TESTS'). In this case, ACME-PLUGIN is a parent of ACME-FUNCTIONAL-TESTS and ACME-UNIT-TESTS, as well as being a child of ACME-CORE.

Build Dependencies and Build Strategies

Build dependencies work together with the build strategy to trigger builds. For example, you can set up your build plan to poll your repository for changes as well as configure build dependencies between builds. In this case, your builds will be triggered when code changes are detected as well as when parent builds complete successfully.
If you want your builds to only be triggered by successful parent builds from your build dependencies, you can do this by specifying "manual & dependent builds only" as the build strategy for your plan. See Triggering a Build Manually.

Tips for setting up dependent builds

Please take note of the following information when setting up dependent builds:

  • Please take care not to create circular dependencies, where your child build triggers one of its parent builds. Otherwise your plans may build continuously.
  • If you specify that a build should run when another build successfully finishes, you may want to prevent it from running at other times. You can achieve this by specifying 'manual & dependent builds only'. See Triggering a Build Manually.
  • If the child build uses the same source as the parent build (e.g. the Subversion URL is the same), the child build will be forced to check out the same revision of source code as the parent build. This ensures that builds are consistent when triggering one build from another.

To trigger a build when another build finishes,

  1. Click 'Home' to go to the Dashboard.
  2. Click the 'All Plans' tab.
  3. Locate the plan in which you are interested.
  4. Click this icon:
  5. The plan's 'Configuration' tab will be displayed. Click the 'Dependencies' sub-tab (see screenshot below).
  6. This will display lists of all plans in your Bamboo system (see screenshot below). All of these are possible 'Parent plans' and 'Child plans' for the current plan. Any dependencies that currently exist for your plan will display, as follows:
    • Manually configured dependency — Any plans that have been manually configured as dependencies will have checked checkboxes against them.
    • Maven 2 dependency — Any plans that have been automatically configured as dependencies via Maven 2 (pom.xml) will have disabled checked checkboxes against them.
  7. Set up the build dependency for your plan as follows:
    • In the 'Dependency Blocking Strategy', select the dependency blocking strategy that you want to apply to this build. Read more about Dependency Blocking Strategies.
      (warning) Please note, dependency blocking only works when triggered by code updates.
    • In the 'Parent plans' list, select any plans for which a successful build should trigger a build for the current plan.
    • In the 'Child plans' list, select any plans for which a build should be triggered when the current plan's build finishes successfully.
  8. 保存」ボタンをクリックします。

Screenshot: 'Plan Configuration — Dependencies'