public class Plan extends RootEntityPropertiesBuilder<PlanProperties>
In RSS mode, can also represent configuration of a Specs plan branch.
Constructor and Description |
---|
Plan(Plan copy) |
Plan(Project project,
String name,
BambooKey key)
Specify plan with given project, name and key.
|
Plan(Project project,
String name,
String key)
Specify plan with given project, name and key.
|
Modifier and Type | Method and Description |
---|---|
Plan |
branchConfiguration(PlanBranchConfiguration planBranchConfiguration)
On a Specs plan branch, defines branch specific configuration.
|
protected PlanProperties |
build() |
Plan |
dependencies(Dependencies dependencies)
Specifies configuration of dependencies support for this plan.
|
Plan |
description(String description)
Sets the plan's description.
|
Plan |
enabled(boolean enabled)
Enables/disables the plan.
|
Plan |
forceStopHungBuilds()
Use this method to configure Bamboo to stop hung build and kill all processes executed by current plan.
|
PlanIdentifier |
getIdentifier()
Returns identifier for this object.
|
BambooKey |
getKey()
Returns plan's key.
|
BambooOid |
getOid()
Returns plan's oid.
|
String |
humanReadableId()
Entity type and id representation that is shown to human.
|
String |
humanReadableType()
Entity type that is shown to human.
|
Plan |
ignoreHungBuilds()
Use this method to ignore hung build and allow user to stop it manually.
|
Plan |
inProject(Project project)
Sets the project plan belongs to.
|
Plan |
key(BambooKey key)
Sets the plan's key.
|
Plan |
key(String key)
Sets the plan's key.
|
Plan |
labels(Label... labels)
Adds labels to this plan.
|
Plan |
labels(String... labels)
Adds labels to this plan.
|
Plan |
linkedRepositories(String... repositoriesNames)
Adds linked repositories with given names to this plan.
|
Plan |
linkedRepositories(VcsRepositoryIdentifier... repositories)
Deprecated.
since 6.2, use
linkedRepositories(String...) |
Plan |
name(String name)
Sets the plan name.
|
Plan |
noDependencies()
Deprecated.
|
Plan |
noLabels()
Deprecated.
|
Plan |
noNotifications()
Deprecated.
|
Plan |
noPluginConfigurations()
Deprecated.
|
Plan |
notifications(Notification... notifications)
Appends a notification rule to the plan.
|
Plan |
oid(BambooOid oid)
Sets the plans's oid.
|
Plan |
oid(String oid)
Sets the plans's oid.
|
Plan |
planBranchManagement(PlanBranchManagement planBranchManagement)
Specifies plan branch management options for this plan.
|
Plan |
planRepositories(VcsRepository<?,?>... repositories)
Adds local repositories to this plan.
|
Plan |
pluginConfigurations(PluginConfiguration<?>... pluginConfigurations)
Appends plugin configuration to the plan.
|
Plan |
repositoryBranches(VcsRepositoryBranch... repositoryBranches)
Defines which branches should be built by this plan or plan branch.
|
Plan |
stages(Stage... stages)
Adds the stages to the end of stages list.
|
Plan |
triggers(Trigger<?,?>... triggers)
Adds triggers to this plan.
|
Plan |
variables(Variable... variables)
Adds plan variables.
|
public static final String TYPE
public Plan(@NotNull Plan copy)
public Plan(@NotNull Project project, @NotNull String name, @NotNull String key) throws PropertiesValidationException
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.
project
- project this plan belongs to. Project must exist.name
- plan's namekey
- plan's short key, must be unique within the project.PropertiesValidationException
oid(String)
public Plan(@NotNull Project project, @NotNull String name, @NotNull BambooKey key) throws PropertiesValidationException
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.
project
- project this plan belongs to. Project must exist.name
- plan's namekey
- plan's short key, must be unique within the project.PropertiesValidationException
oid(String)
public Plan inProject(@NotNull Project project) throws PropertiesValidationException
PropertiesValidationException
public Plan name(@NotNull String name) throws PropertiesValidationException
Ignored on branches.
PropertiesValidationException
public Plan key(@Nullable String key) throws PropertiesValidationException
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.
key
- plan's short key, must be unique within the project.PropertiesValidationException
oid(String)
public Plan key(@Nullable BambooKey key) throws PropertiesValidationException
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.
key
- plan's short key, must be unique within the project.PropertiesValidationException
oid(String)
public Plan oid(@Nullable String oid) throws PropertiesValidationException
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.
PropertiesValidationException
public Plan oid(@Nullable BambooOid oid) throws PropertiesValidationException
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.
PropertiesValidationException
public Plan description(@Nullable String description) throws PropertiesValidationException
PropertiesValidationException
public Plan stages(@NotNull Stage... stages)
public Plan planRepositories(@NotNull VcsRepository<?,?>... repositories)
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()
public Plan linkedRepositories(@NotNull String... repositoriesNames)
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.
@Deprecated public Plan linkedRepositories(@NotNull VcsRepositoryIdentifier... repositories)
linkedRepositories(String...)
This method will link existing global repositories to this plan. To add plan-local repository definitions
instead, use planRepositories(VcsRepository[])
.
public Plan repositoryBranches(@NotNull VcsRepositoryBranch... repositoryBranches)
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()
public Plan enabled(boolean enabled) throws PropertiesValidationException
PropertiesValidationException
public Plan planBranchManagement(@NotNull PlanBranchManagement planBranchManagement) throws PropertiesValidationException
This settings are only applied on the default branch and as defaults for non-Specs branches.
PropertiesValidationException
PlanBranchManagement
public Plan branchConfiguration(@NotNull PlanBranchConfiguration planBranchConfiguration) throws PropertiesValidationException
PropertiesValidationException
public Plan dependencies(@NotNull Dependencies dependencies) throws PropertiesValidationException
Ignored on branches.
PropertiesValidationException
Dependencies
@Deprecated public Plan noDependencies()
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.
public Plan pluginConfigurations(@NotNull PluginConfiguration<?>... pluginConfigurations)
Ignored on branches.
@Deprecated public Plan noPluginConfigurations()
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.
public Plan notifications(@NotNull Notification... notifications)
@Deprecated public Plan noNotifications()
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.
public Plan forceStopHungBuilds()
Ignored on branches.
public Plan ignoreHungBuilds()
Ignored on branches.
@Deprecated public Plan noLabels()
If your plan doesn't need any labels, don't add eny with labels(String...)
nor with
labels(Label...)
. There's no need to explicitly call this method.
@NotNull public PlanIdentifier getIdentifier()
IllegalStateException
- if key is undefined@NotNull public BambooKey getKey()
IllegalStateException
- if key is undefined@NotNull public BambooOid getOid()
IllegalStateException
- if oid is undefinedprotected PlanProperties build() throws PropertiesValidationException
build
in class EntityPropertiesBuilder<PlanProperties>
PropertiesValidationException
public String humanReadableType()
RootEntityPropertiesBuilder
humanReadableType
in class RootEntityPropertiesBuilder<PlanProperties>
public String humanReadableId()
RootEntityPropertiesBuilder
humanReadableId
in class RootEntityPropertiesBuilder<PlanProperties>
Copyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.