Class DeploymentRepositoryBuildContext
- java.lang.Object
-
- com.atlassian.bamboo.vcs.configuration.legacy.DeploymentRepositoryBuildContext
-
- All Implemented Interfaces:
BuildContext
,BuildIdentifier
,CommonContext
,Serializable
public class DeploymentRepositoryBuildContext extends Object implements BuildContext
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DeploymentRepositoryBuildContext(CommonContext commonContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull ArtifactContext
getArtifactContext()
@NotNull BambooBandanaContext
getBandanaContext()
BandanaContext of the plan.@NotNull BuildChanges
getBuildChanges()
Returns the build changes, if any, that represents the changes that triggered this build.@NotNull BuildDefinition
getBuildDefinition()
@NotNull BuildKey
getBuildKey()
int
getBuildNumber()
The build number being built@NotNull CurrentBuildResult
getBuildResult()
The information about the results of a build@NotNull String
getBuildResultKey()
Full build result key (e.g.@NotNull Map<PlanKey,ChainStorageTag>
getChainStorageTags()
@NotNull Map<Long,String>
getCheckoutLocation()
Map holds final checkout where repository was checked out by VcsCheckoutTask Elements are kept in order of checkoutCurrentResult
getCurrentResult()
String
getDisplayName()
A human friendly description of what is being built.@NotNull DockerPipelineConfiguration
getDockerPipelineConfiguration()
Long
getEntityGroupId()
Returns id of a group entity belongs to.long
getEntityId()
Key
getEntityKey()
@NotNull ErrorCollection
getErrorCollection()
Any errors associated with the buildOptional<Long>
getMasterPlanId()
long
getMaximumBuildWarningsCount()
@Nullable MergeResultContext
getMergeResult()
If a build performs merge, this method returns the result.@Nullable BuildContext
getParentBuildContext()
If this context is forImmutableJob
returns context of owner chain, null otherwise.@Nullable BuildIdentifier
getParentBuildIdentifier()
Optional<Long>
getPlanDbId()
long
getPlanId()
@NotNull String
getPlanKey()
Full plan key (e.g.@NotNull String
getPlanName()
The full name of thePlan
@NotNull PlanResultKey
getPlanResultKey()
Gets thePlanResultKey
for the currentBuildIdentifier
@NotNull String
getProjectName()
@NotNull Set<Long>
getRelevantRepositoryIds()
ResultKey
getResultKey()
@NotNull List<RuntimeTaskDefinition>
getRuntimeTaskDefinitions()
All tasks defined for this build.@NotNull Iterable<CredentialsData>
getSharedCredentials()
@NotNull String
getShortName()
The short name of thePlan
@NotNull TriggerReason
getTriggerReason()
The reason this build was triggered@NotNull PlanKey
getTypedPlanKey()
Full plan key (e.g.@NotNull UUID
getUuid()
Id of the run.@NotNull VariableContext
getVariableContext()
@NotNull List<PlanRepositoryDefinition>
getVcsRepositories()
@NotNull Map<Long,PlanRepositoryDefinition>
getVcsRepositoryMap()
boolean
isBranch()
Provides information if context refers to the branch of the Chainboolean
isCustomBuild()
Provides information if context refers to the build that had some variables overwrittenboolean
isExpectingCustomDedicatedAgent()
If this job is expected to be built on a custom dedicated agentboolean
isOnceOff()
Provides information if context refers to the "once-off" build - a build that have been run with customized revisionboolean
isVerboseLoggingOn()
Controls the amount of logging during the execution.void
setBuildChanges(BuildChanges buildChanges)
void
setMergeResult(@Nullable MergeResultContext mergeResult)
void
setVariableContext(@NotNull VariableContext variableContext)
-
-
-
Constructor Detail
-
DeploymentRepositoryBuildContext
public DeploymentRepositoryBuildContext(CommonContext commonContext)
-
-
Method Detail
-
getBuildKey
@NotNull public @NotNull BuildKey getBuildKey()
- Specified by:
getBuildKey
in interfaceCommonContext
-
getParentBuildContext
@Nullable public @Nullable BuildContext getParentBuildContext()
Description copied from interface:BuildContext
If this context is forImmutableJob
returns context of owner chain, null otherwise. Note: modifying parent context by job-level actions, such asPreJobAction
is not thread safe and is not supported.- Specified by:
getParentBuildContext
in interfaceBuildContext
- Returns:
- the
BuildContext
of the parentPlan
execution. Should return null if the currentBuildContext
is for aTopLevelPlan
-
getBuildDefinition
@NotNull public @NotNull BuildDefinition getBuildDefinition()
- Specified by:
getBuildDefinition
in interfaceBuildContext
- Returns:
- BuildDefinition associated with Plan this context relates to
-
getArtifactContext
@NotNull public @NotNull ArtifactContext getArtifactContext()
- Specified by:
getArtifactContext
in interfaceBuildContext
- Specified by:
getArtifactContext
in interfaceCommonContext
- Returns:
- Artifact data associated with Plan
-
getBuildChanges
@NotNull public @NotNull BuildChanges getBuildChanges()
Description copied from interface:BuildContext
Returns the build changes, if any, that represents the changes that triggered this build.- Specified by:
getBuildChanges
in interfaceBuildContext
- Returns:
- Never null. WIll return a build changes object with the appropriate list of changes, the list will be null if no changes were found.
-
setBuildChanges
public void setBuildChanges(BuildChanges buildChanges)
- Specified by:
setBuildChanges
in interfaceBuildContext
-
getBuildResult
@NotNull public @NotNull CurrentBuildResult getBuildResult()
Description copied from interface:BuildContext
The information about the results of a build- Specified by:
getBuildResult
in interfaceBuildContext
- Returns:
CurrentBuildResult
-
getRelevantRepositoryIds
@NotNull public @NotNull Set<Long> getRelevantRepositoryIds()
- Specified by:
getRelevantRepositoryIds
in interfaceBuildContext
- Returns:
- a set of repository id's that are relevant to this particular job, i.e. these jobs do checkout of that repository
-
getCheckoutLocation
@NotNull public @NotNull Map<Long,String> getCheckoutLocation()
Description copied from interface:BuildContext
Map holds final checkout where repository was checked out by VcsCheckoutTask Elements are kept in order of checkout- Specified by:
getCheckoutLocation
in interfaceBuildContext
- Returns:
- map of repositoryId as Long and checkout location as String
-
isBranch
public boolean isBranch()
Description copied from interface:BuildContext
Provides information if context refers to the branch of the Chain- Specified by:
isBranch
in interfaceBuildContext
- Returns:
- true if context refers to the chain branch
-
isOnceOff
public boolean isOnceOff()
Description copied from interface:BuildContext
Provides information if context refers to the "once-off" build - a build that have been run with customized revision- Specified by:
isOnceOff
in interfaceBuildContext
- Returns:
- true if context refers to the chain branch
-
isCustomBuild
public boolean isCustomBuild()
Description copied from interface:BuildContext
Provides information if context refers to the build that had some variables overwritten- Specified by:
isCustomBuild
in interfaceBuildContext
- Returns:
- true if context refers to the build with overwritten variables
-
isVerboseLoggingOn
public boolean isVerboseLoggingOn()
Description copied from interface:CommonContext
Controls the amount of logging during the execution. Some of the logging is only output in verbose mode.- Specified by:
isVerboseLoggingOn
in interfaceCommonContext
- Returns:
- true if verbose logging is enabled.
-
getEntityId
public long getEntityId()
- Specified by:
getEntityId
in interfaceCommonContext
-
getEntityKey
public Key getEntityKey()
- Specified by:
getEntityKey
in interfaceCommonContext
-
getResultKey
public ResultKey getResultKey()
- Specified by:
getResultKey
in interfaceCommonContext
-
getDisplayName
public String getDisplayName()
Description copied from interface:CommonContext
A human friendly description of what is being built.- Specified by:
getDisplayName
in interfaceCommonContext
- Returns:
-
getCurrentResult
public CurrentResult getCurrentResult()
- Specified by:
getCurrentResult
in interfaceCommonContext
-
getErrorCollection
@NotNull public @NotNull ErrorCollection getErrorCollection()
Description copied from interface:CommonContext
Any errors associated with the build- Specified by:
getErrorCollection
in interfaceCommonContext
-
getRuntimeTaskDefinitions
@NotNull public @NotNull List<RuntimeTaskDefinition> getRuntimeTaskDefinitions()
Description copied from interface:CommonContext
All tasks defined for this build. Contains both regular tasks and finalising tasks.- Specified by:
getRuntimeTaskDefinitions
in interfaceCommonContext
- Returns:
- A
List
ofRuntimeTaskDefinition
s
-
getVariableContext
@NotNull public @NotNull VariableContext getVariableContext()
- Specified by:
getVariableContext
in interfaceCommonContext
-
getTriggerReason
@NotNull public @NotNull TriggerReason getTriggerReason()
Description copied from interface:CommonContext
The reason this build was triggered- Specified by:
getTriggerReason
in interfaceCommonContext
- Returns:
- triggerReason
-
getBandanaContext
@NotNull public @NotNull BambooBandanaContext getBandanaContext()
Description copied from interface:BuildContext
BandanaContext of the plan.- Specified by:
getBandanaContext
in interfaceBuildContext
- Returns:
BandanaContext
of the plan
-
getChainStorageTags
@NotNull public @NotNull Map<PlanKey,ChainStorageTag> getChainStorageTags()
- Specified by:
getChainStorageTags
in interfaceCommonContext
-
getSharedCredentials
@NotNull public @NotNull Iterable<CredentialsData> getSharedCredentials()
- Specified by:
getSharedCredentials
in interfaceCommonContext
-
getParentBuildIdentifier
@Nullable public @Nullable BuildIdentifier getParentBuildIdentifier()
- Specified by:
getParentBuildIdentifier
in interfaceBuildIdentifier
- Returns:
- the
BuildContext
of the parentPlan
execution. Should return null if the currentBuildContext
is for aChain
-
getPlanId
public long getPlanId()
- Specified by:
getPlanId
in interfaceBuildIdentifier
- Returns:
- Database id of the plan.
-
getPlanDbId
public Optional<Long> getPlanDbId()
- Specified by:
getPlanDbId
in interfaceBuildIdentifier
- Returns:
- Id of the plan or empty if N/A.
-
getPlanKey
@NotNull public @NotNull String getPlanKey()
Description copied from interface:BuildIdentifier
Full plan key (e.g. BAM-MAIN)- Specified by:
getPlanKey
in interfaceBuildIdentifier
- Returns:
- Key for the plan BAM-MAIN
-
getTypedPlanKey
@NotNull public @NotNull PlanKey getTypedPlanKey()
Description copied from interface:BuildIdentifier
Full plan key (e.g. BAM-MAIN)- Specified by:
getTypedPlanKey
in interfaceBuildIdentifier
- Returns:
- Key for the plan BAM-MAIN
-
getPlanName
@NotNull public @NotNull String getPlanName()
Description copied from interface:BuildIdentifier
The full name of thePlan
- Specified by:
getPlanName
in interfaceBuildIdentifier
- Returns:
DescriptionProvider.getName()
-
getShortName
@NotNull public @NotNull String getShortName()
Description copied from interface:BuildIdentifier
The short name of thePlan
- Specified by:
getShortName
in interfaceBuildIdentifier
- Returns:
PlanIdentifier.getBuildName()
-
getBuildNumber
public int getBuildNumber()
Description copied from interface:BuildIdentifier
The build number being built- Specified by:
getBuildNumber
in interfaceBuildIdentifier
- Returns:
- int
-
getBuildResultKey
@NotNull public @NotNull String getBuildResultKey()
Description copied from interface:BuildIdentifier
Full build result key (e.g. BAM-MAIN-100)- Specified by:
getBuildResultKey
in interfaceBuildIdentifier
- Returns:
- Key for build result
-
getPlanResultKey
@NotNull public @NotNull PlanResultKey getPlanResultKey()
Description copied from interface:BuildIdentifier
Gets thePlanResultKey
for the currentBuildIdentifier
- Specified by:
getPlanResultKey
in interfaceBuildIdentifier
- Returns:
- planResultKey
-
getProjectName
@NotNull public @NotNull String getProjectName()
- Specified by:
getProjectName
in interfaceBuildIdentifier
-
setVariableContext
public void setVariableContext(@NotNull @NotNull VariableContext variableContext)
- Specified by:
setVariableContext
in interfaceBuildContext
-
getVcsRepositoryMap
@NotNull public @NotNull Map<Long,PlanRepositoryDefinition> getVcsRepositoryMap()
- Specified by:
getVcsRepositoryMap
in interfaceCommonContext
-
getVcsRepositories
@NotNull public @NotNull List<PlanRepositoryDefinition> getVcsRepositories()
- Specified by:
getVcsRepositories
in interfaceCommonContext
-
getEntityGroupId
public Long getEntityGroupId()
Description copied from interface:CommonContext
Returns id of a group entity belongs to. E.g. returns deployment project's id if entity is a deployment environment.- Specified by:
getEntityGroupId
in interfaceCommonContext
- Returns:
- id of entity group or null if not applicable.
-
getMaximumBuildWarningsCount
public long getMaximumBuildWarningsCount()
- Specified by:
getMaximumBuildWarningsCount
in interfaceBuildContext
-
getDockerPipelineConfiguration
@NotNull public @NotNull DockerPipelineConfiguration getDockerPipelineConfiguration()
- Specified by:
getDockerPipelineConfiguration
in interfaceCommonContext
-
getMasterPlanId
public Optional<Long> getMasterPlanId()
- Specified by:
getMasterPlanId
in interfaceBuildIdentifier
- Returns:
- id of the master plan or empty if plan has no master.
-
getMergeResult
@Nullable public @Nullable MergeResultContext getMergeResult()
Description copied from interface:BuildContext
If a build performs merge, this method returns the result.- Specified by:
getMergeResult
in interfaceBuildContext
-
setMergeResult
public void setMergeResult(@Nullable @Nullable MergeResultContext mergeResult)
- Specified by:
setMergeResult
in interfaceBuildContext
-
getUuid
@NotNull public @NotNull UUID getUuid()
Description copied from interface:BuildIdentifier
Id of the run. Allows to tell apart instances of build if a job is restarted.- Specified by:
getUuid
in interfaceBuildIdentifier
-
isExpectingCustomDedicatedAgent
public boolean isExpectingCustomDedicatedAgent()
Description copied from interface:CommonContext
If this job is expected to be built on a custom dedicated agent- Specified by:
isExpectingCustomDedicatedAgent
in interfaceCommonContext
-
-