You may want to trigger a Plan build when another Plan's build has successfully completed. This ensures that changes to any Job's source code associated with one Plan does not break the build of another dependent Plan (known in this context as a 'child' Plan).
For example, there could be two Plans in Bamboo:
- Acme – Core — アプリケーションのコア コードが含まれています。
- Acme – Plugin — アプリケーションのプラグインのコードが含まれています。
In this scenario, the Acme – Plugin Plan is a child of Acme – Core. Any changes to source code associated with the Acme – Core Plan should trigger a build of Acme – Plugin. In turn, every time a Acme – Plugin Plan build completes successfully, you may want to run builds for some additional Plans (e.g Acme – Functional Tests and Acme – Unit Tests). In this case, Acme – Plugin is a parent of the Acme – Functional Tests and Acme – Unit Tests Plans, as well as being a child of the Acme – Core Plan.
Manual Dependency Management
To trigger a build when another build finishes:
- Click 'Home' to go to the Dashboard.
- Click the 'All Plans' tab.
- Locate the plan in the list and click the 'Edit' icon
to display the Plan's Configuration pages. - Click the 'Dependencies' tab
- Locate the Manual Dependency Management section — All Plans in your Bamboo system (other than the one you are configuring) are listed in two 'Parent plans' and 'Child plans' sections (see screenshot below). Select the check boxes of the Plans in the following subsections:
- Child plans — Plans whose builds you want triggered as a result of successful completion of the Plan you are configuring.
- Parent plans — Plans whose successful completion will trigger a build of the Plan you are configuring. Any other Plans in your Bamboo system that specify build dependencies, with the Plan you are configuring, will have their check boxes selected.
- 「保存」ボタンをクリックします。
Automatic Dependency Management with Maven 2
Automatic Dependency Management is a feature for users who use Maven 2 and wish for their Parent and Child dependencies to be setup according to the dependencies in the Maven pom.xml. Every time the plan is run, the Bamboo Automatic Dependencies are updated to reflect any additions or removals of Maven dependencies.
To setup Automatic Dependency Management:
- Click 'Home' to go to the Dashboard.
- Click the 'All Plans' tab.
- Locate the plan in the list and click the 'Edit' icon
to display the Plan's Configuration pages. - Locate the Job using the Plan Navigator that contains the pom.xml you wish to use to automatically update Plan dependencies by analysing a Maven pom file.
- Click on the Tasks tab
- Add the Maven Dependency Processor Task to the Job. For best results, ensure that the Task runs last by dragging it to the bottom of the Task list. For more information on configuring Tasks, see Configuring Tasks.
- Override Project File (Optional) — The location relative to the working directory or sub-working directory where the project file (pom.xml) is located.
- Working Sub Directory (Optional) — The sub directory from which the Task should look for the project file (pom.xml)
- Alternate location of settings.xml (Optional) — Specify an alternate settings.xml to be used if the Task needs to resolve dependencies from specific Maven repositories.
- Path to Maven local repository (Optional) — Specify a full path to a local Maven repository for the Task to use to resolve dependencies.
- 「保存」ボタンをクリックします。
- Use the Plan Navigator on the left to return to the Plan
- Click the Dependencies tab
- Locate the Automatic Dependency Management section
- Select the Automatic Dependency Management checkbox. You should see the name of the Job that you configured the Maven Dependency Processor with appear underneath the option.
- Click the 'Save' button
Dependency Blocking
Dependency blocking is a advanced feature of dependent build triggering that can be used to manage Plan builds with parent build dependencies. This ensures that a "tree" of dependent builds always runs in tree hierarchy order, even if child Plan builds are triggered independently of their parents. For more information, see Dependency Blocking Strategies. Please note, dependency blocking only works when the Plan uses a build strategy based on source code updates.
注意
Build Dependencies and Build Strategies
Build dependencies work together with the build strategies of Plans to trigger builds of these Plans. For example, you can set up Plan A to poll its repository for changes as well as configure a build dependency on a parent Plan (Plan B). In such a case, builds of Plan A will be triggered when code changes are detected in its repository as well as when builds of Plan B 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 Plan Build Manually.
- Tips for Setting Up Dependent Builds— Please take note of the following information when setting up dependent builds:
- 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 Plan 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.