すべてのバージョン
Bamboo 5.13Bamboo 5.7.x
Bamboo 5.6.x
More...
Available: |
Bamboo 2.7 and later |
|---|
On this page:
Additional Build Configuration Module allows developers to register additional configuration UI on the Miscellaneous tab of the Configuration of a Job or Plan.
The root element for the Additional Build Configuration module is additionalBuildConfigurationPlugin. It allows the following attributes and child elements for configuration:
名前 |
必須 |
説明 |
既定 |
|---|---|---|---|
クラス |
|
[Unable to render {include} The included page could not be found. ({include} をレンダリングできません。ページが見つかりませんでした)] を選択し、 |
|
鍵 (キー) |
|
[Unable to render {include} The included page could not be found. ({include} をレンダリングできません。ページが見つかりませんでした)] を選択し、 |
N/A |
name |
|
[Unable to render {include} The included page could not be found. ({include} をレンダリングできません。ページが見つかりませんでした)] を選択し、 Only used in the plugin's administrative user interface. |
|
The table summarises the elements. The sections below contain further information.
名前 |
必須 |
説明 |
既定 |
|---|---|---|---|
description |
|
[Unable to render {include} The included page could not be found. ({include} をレンダリングできません。ページが見つかりませんでした)] を選択し、 Use this element to describe the section. |
|
resource |
|
Using the "edit" and "view" attributes it is possible to provide a custom template for editing and viewing your custom plugin configuration |
|
Additional Build Configuration modules must implement the MiscellaneousBuildConfigurationPlugin interface and extend BaseBuildConfigurationAwarePlugin.
Here is an example atlassian-plugin.xml file containing a Post Chain Index Writer Action module:
<atlassian-plugin name="Hello World" key="example.plugin.helloworld">
<plugin-info>
<description>A Additional Build Configuration Module module type test</description>
<vendor name="Atlassian Software Systems" url="http://www.atlassian.com"/>
<version>1.0</version>
</plugin-info>
<additionalBuildConfigurationPlugin key="concurrentBuild" name="Concurrent Build Configuration"
class="com.atlassian.bamboo.build.configuration.ConcurrentBuildsPlanConfigurationPlugin">
<description>Plugin to configure maximum number of concurrent builds for a plan</description>
<resource type="freemarker" name="edit" location="build/concurrent/editConcurrentBuildsConfigForPlan.ftl"/>
<resource type="freemarker" name="view" location="build/concurrent/viewConcurrentBuildsConfigForPlan.ftl"/>
</additionalBuildConfigurationPlugin>
</atlassian-plugin>
Example "edit" template:
[@ui.bambooSection titleKey="build.concurrent.title"]
[@ww.checkbox labelKey='build.concurrent.overrideDefault'
name='custom.concurrentBuilds.overrideNumberOfConcurrentBuilds'
toggle='true' /]
[@ui.bambooSection dependsOn='custom.concurrentBuilds.overrideNumberOfConcurrentBuilds' showOn='true']
[@ww.textfield labelKey='build.concurrent.maxnumber'
name='custom.concurrentBuilds.numberOfConcurrentBuilds'
/]
[/@ui.bambooSection]
[/@ui.bambooSection]
Example "view" template:
[#if action.concurrentBuildsEnabled && planLevelConcurrentBuildConfig.defaultOverridden]
[#assign labelValue]${planLevelConcurrentBuildConfig.effectiveNumberOfConcurrentBuilds}[#if !planLevelConcurrentBuildConfig.defaultOverridden] (${action.getText('global.default.used')})[/#if][/#assign]
[@ww.label labelKey='build.concurrent.maxnumber' value='${labelValue}' /]
[/#if]
By overriding isApplicableTo it is possible to control the conditions on which the configuration UI is shown. One typical implementation is to check and only display on a plans type.
To display on all TopLevelPlan's (Chains and Builds):
public boolean isApplicableTo(@NotNull Plan plan)
{
return plan instanceof TopLevelPlan;
}
To display only on Jobs:
public boolean isApplicableTo(@NotNull Plan plan)
{
return plan instanceof Job;
}