Class Plan
In RSS mode, can also represent configuration of a Specs plan branch.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbranchConfiguration
(@NotNull PlanBranchConfiguration planBranchConfiguration) On a Specs plan branch, defines branch specific configuration.protected PlanProperties
build()
Clears all notifications previously added to this plan.Clears all previously added triggers to this plan.dependencies
(@NotNull Dependencies dependencies) Specifies configuration of dependencies support for this plan.description
(@Nullable String description) Sets the plan's description.enabled
(boolean enabled) Enables/disables the plan.Deprecated.since 9.3.@NotNull PlanIdentifier
Returns identifier for this object.@NotNull BambooKey
getKey()
Returns plan's key.@NotNull BambooOid
getOid()
Returns plan's oid.Entity type and id representation that is shown to human.Entity type that is shown to human.Deprecated.since 9.3.Sets the project plan belongs to.Sets the plan's key.Sets the plan's key.Adds labels to this plan.Adds labels to this plan.linkedRepositories
(@NotNull VcsRepositoryIdentifier... repositories) Deprecated.since 6.2, uselinkedRepositories(String...)
linkedRepositories
(@NotNull String... repositoriesNames) Adds linked repositories with given names to this plan.Sets the plan name.Deprecated.noLabels()
Deprecated.Deprecated.Deprecated.notifications
(@NotNull Notification... notifications) Appends a notification rule to the plan.Sets the plans's oid.Sets the plans's oid.planBranchManagement
(@NotNull PlanBranchManagement planBranchManagement) Specifies plan branch management options for this plan.planRepositories
(@NotNull VcsRepository<?, ?>... repositories) Adds local repositories to this plan.pluginConfigurations
(@NotNull PluginConfiguration<?>... pluginConfigurations) Appends plugin configuration to the plan.projectRepositories
(@NotNull String... repositoriesNames) Adds project repositories with given names to this plan.repositoryBranches
(@NotNull VcsRepositoryBranch... repositoryBranches) Defines which branches should be built by this plan or plan branch.Adds the stages to the end of stages list.Adds triggers to this plan.Adds plan variables.
-
Field Details
-
TYPE
- See Also:
-
-
Constructor Details
-
Plan
-
Plan
public Plan(@NotNull @NotNull Project project, @NotNull @NotNull String name, @NotNull @NotNull String key) throws PropertiesValidationException Specify plan with given project, name and key.If oid is not specified, key serves as a plan identifier. If a plan with specified key does not exist, a new one is created, otherwise it is updated.
When defining a Specs branch, these parameters should identify the master plan. Plan branch key and name are generated automatically.
- Parameters:
project
- project this plan belongs to. Project must exist.name
- plan's namekey
- plan's short key, must be unique within the project.- Throws:
PropertiesValidationException
- See Also:
-
Plan
public Plan(@NotNull @NotNull Project project, @NotNull @NotNull String name, @NotNull @NotNull BambooKey key) throws PropertiesValidationException Specify plan with given project, name and key.If oid is not specified, key serves as a plan identifier. If a plan with specified key does not exist, a new one is created, otherwise it is updated.
When defining a Specs branch, these parameters should identify the master plan. Plan branch key and name are generated automatically.
- Parameters:
project
- project this plan belongs to. Project must exist.name
- plan's namekey
- plan's short key, must be unique within the project.- Throws:
PropertiesValidationException
- See Also:
-
-
Method Details
-
inProject
Sets the project plan belongs to. Project must exist.- Throws:
PropertiesValidationException
-
name
Sets the plan name.Ignored on branches.
- Throws:
PropertiesValidationException
-
key
Sets the plan's key.If oid is not specified, key serves as a plan identifier. If a plan with specified key does not exist, a new one is created, otherwise it is updated.
When defining a Specs branch, should identify the master plan. Plan branch key and name are generated automatically.
- Parameters:
key
- plan's short key, must be unique within the project.- Throws:
PropertiesValidationException
- See Also:
-
key
Sets the plan's key.If oid is not specified, key serves as a plan identifier. If a plan with specified key does not exist, a new one is created, otherwise it is updated.
When defining a Specs branch, should identify the master plan. Plan branch key and name are generated automatically.
- Parameters:
key
- plan's short key, must be unique within the project.- Throws:
PropertiesValidationException
- See Also:
-
oid
Sets the plans's oid.If set, it is used to identify the plan. If a plan with specified oid does not exist, a new one is created, otherwise it is updated.
When defining a Specs branch, should identify the master plan. Oid of a plan branch is generated automatically.
- Throws:
PropertiesValidationException
-
oid
Sets the plans's oid.If set, it is used to identify the plan. If a plan with specified oid does not exist, a new one is created, otherwise it is updated.
When defining a Specs branch, should identify the master plan. Oid of a plan branch is generated automatically.
- Throws:
PropertiesValidationException
-
description
public Plan description(@Nullable @Nullable String description) throws PropertiesValidationException Sets the plan's description.- Throws:
PropertiesValidationException
-
stages
Adds the stages to the end of stages list. The order of stages is preserved. -
planRepositories
Adds local repositories to this plan.This method will create new plan-local repository definitions for this plan. To link plan to global repositories instead, use
linkedRepositories(String[])
.The list of repositories on branches must match the master plan, that is, while the repositories can have different configuration their names must match repositories defined for the master plan.
Redefinition of a default repository is not possible at all on Specs branch. Any such settings will be ignored and default repository will be set to match the current branch. See also
RssRuntimeContext.getCurrentRssBranch()
-
linkedRepositories
Adds linked repositories with given names to this plan.This method will link existing global repositories to this plan. To add plan-local repository definitions instead, use
planRepositories(VcsRepository[])
.The list of repositories on branches must match the master plan, that is, while the repositories can have different configuration their names must match repositories defined for the master plan.
On branch: in order to avoid unnecessary redefinition of a plan repository, this method can be also used to reference it.
-
linkedRepositories
@Deprecated public Plan linkedRepositories(@NotNull @NotNull VcsRepositoryIdentifier... repositories) Deprecated.since 6.2, uselinkedRepositories(String...)
Adds linked repositories to this plan.This method will link existing global repositories to this plan. To add plan-local repository definitions instead, use
planRepositories(VcsRepository[])
. -
projectRepositories
Adds project repositories with given names to this plan. Available for Bamboo DC only.This method will link existing project repositories to this plan. To add plan-local repository definitions instead, use
planRepositories(VcsRepository[])
.The list of repositories on branches must match the master plan, that is, while the repositories can have different configuration their names must match repositories defined for the master plan.
On branch: in order to avoid unnecessary redefinition of a plan repository, this method can be also used to reference it.
- Since:
- 8.0
-
repositoryBranches
Defines which branches should be built by this plan or plan branch. Arguments can reference any repository attached to the plan (local or linked).Redefinition of a default repository is not possible at all on Specs branch. Any such settings will be ignored and default repository will be set to match the current branch. See also
RssRuntimeContext.getCurrentRssBranch()
-
triggers
Adds triggers to this plan. -
clearTriggers
Clears all previously added triggers to this plan. -
variables
Adds plan variables. -
enabled
Enables/disables the plan.- Throws:
PropertiesValidationException
-
planBranchManagement
public Plan planBranchManagement(@NotNull @NotNull PlanBranchManagement planBranchManagement) throws PropertiesValidationException Specifies plan branch management options for this plan. These options control if and how Bamboo should perform automatic branch management.This settings are only applied on the default branch and as defaults for non-Specs branches.
- Throws:
PropertiesValidationException
- See Also:
-
branchConfiguration
public Plan branchConfiguration(@NotNull @NotNull PlanBranchConfiguration planBranchConfiguration) throws PropertiesValidationException On a Specs plan branch, defines branch specific configuration. Has no effect on master plan.- Throws:
PropertiesValidationException
-
dependencies
public Plan dependencies(@NotNull @NotNull Dependencies dependencies) throws PropertiesValidationException Specifies configuration of dependencies support for this plan.Ignored on branches.
- Throws:
PropertiesValidationException
- See Also:
-
noDependencies
Deprecated.Use this method to specify that your plan has no dependencies. If you have dependencies on other plans specified in Bamboo and you use this method in Bamboo Specs, your existing plan dependencies will be cleaned. Introduced for migration option for plans created via Specs in Bamboo 6.0.
If your plan doesn't have dependencies on other plans, don't configure any dependencies. No need to explicit using this method.
-
pluginConfigurations
Appends plugin configuration to the plan. If the same plugin is specified second time, its configuration is overwritten.Ignored on branches.
-
noPluginConfigurations
Deprecated.Use this method to specify that your plan has default plugins configuration. If you have any plugin configuration specified in Bamboo and you use this method in Bamboo Specs, your existing plan plugin configuration will be cleaned. Introduced for migration option for plans created via Specs in Bamboo 6.0.
If you want to have default plugin configuration for your plan, don't introduce any plugin configuration. No need to explicit using this method.
-
notifications
Appends a notification rule to the plan. -
clearNotifications
Clears all notifications previously added to this plan. -
noNotifications
Deprecated.Use this method to specify that your plan has no notification rules. If you have notification rules specified in Bamboo and you use this method in Bamboo Specs, your existing plan notification rules will be cleaned. Introduced for migration option for plans created via Specs in Bamboo 6.0.
If you don't want notifications for your plan, don't configure any. No need to explicitly using this method.
-
forceStopHungBuilds
Deprecated.since 9.3. Use #pluginConfigurations(new ForceStopBuild().enabled(true))Use this method to configure Bamboo to stop hung build and kill all processes executed by current plan. When Build Monitoring is disabled at Bamboo server validation error will be thrown.Ignored on branches.
-
ignoreHungBuilds
Deprecated.since 9.3. Use #pluginConfigurations(new ForceStopBuild().enabled(false))Use this method to ignore hung build and allow user to stop it manually.Ignored on branches.
-
labels
Adds labels to this plan. -
labels
Adds labels to this plan. -
noLabels
Deprecated.Use this method to specify that your plan has no labels. If you have any labels added to your plan in Bamboo and you use this method in Bamboo Specs, your existing labels will be cleaned. Introduced for migration option for plans created via Specs in Bamboo 7.0.If your plan doesn't need any labels, don't add eny with
labels(String...)
nor withlabels(Label...)
. There's no need to explicitly call this method. -
getIdentifier
Returns identifier for this object.- Throws:
IllegalStateException
- if key is undefined
-
getKey
Returns plan's key.- Throws:
IllegalStateException
- if key is undefined
-
getOid
Returns plan's oid.- Throws:
IllegalStateException
- if oid is undefined
-
build
- Specified by:
build
in classEntityPropertiesBuilder<PlanProperties>
- Throws:
PropertiesValidationException
-
humanReadableType
Description copied from class:RootEntityPropertiesBuilder
Entity type that is shown to human.- Specified by:
humanReadableType
in classRootEntityPropertiesBuilder<PlanProperties>
-
humanReadableId
Description copied from class:RootEntityPropertiesBuilder
Entity type and id representation that is shown to human.- Specified by:
humanReadableId
in classRootEntityPropertiesBuilder<PlanProperties>
-