Package com.atlassian.bamboo.v2.build
Interface BuildContext
-
- All Superinterfaces:
BuildIdentifier
,CommonContext
,Serializable
- All Known Implementing Classes:
BuildContextImpl
,DeploymentRepositoryBuildContext
@ThreadSafe @PublicApi public interface BuildContext extends CommonContext, BuildIdentifier
A class that encapsulates how to build a particular plan at a given instance
-
-
Method Summary
All Methods Instance Methods Abstract 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 CurrentBuildResult
getBuildResult()
The information about the results of a build@NotNull Map<Long,String>
getCheckoutLocation()
Map holds final checkout where repository was checked out by VcsCheckoutTask Elements are kept in order of checkoutlong
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.@NotNull Set<Long>
getRelevantRepositoryIds()
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
isOnceOff()
Provides information if context refers to the "once-off" build - a build that have been run with customized revisionvoid
setBuildChanges(BuildChanges buildChanges)
void
setMergeResult(@Nullable MergeResultContext mergeResult)
void
setVariableContext(@NotNull VariableContext variableContext)
-
Methods inherited from interface com.atlassian.bamboo.v2.build.BuildIdentifier
getBuildNumber, getBuildResultKey, getMasterPlanId, getParentBuildIdentifier, getPlanDbId, getPlanId, getPlanKey, getPlanName, getPlanResultKey, getProjectName, getShortName, getTypedPlanKey, getUuid
-
Methods inherited from interface com.atlassian.bamboo.v2.build.CommonContext
getBuildKey, getChainStorageTags, getCurrentResult, getDisplayName, getDockerPipelineConfiguration, getEntityGroupId, getEntityId, getEntityKey, getErrorCollection, getResultKey, getRuntimeTaskDefinitions, getSharedCredentials, getTriggerReason, getVariableContext, getVcsRepositories, getVcsRepositoryMap, isExpectingCustomDedicatedAgent, isVerboseLoggingOn
-
-
-
-
Method Detail
-
getParentBuildContext
@Nullable @Nullable BuildContext getParentBuildContext()
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.- Returns:
- the
BuildContext
of the parentPlan
execution. Should return null if the currentBuildContext
is for aTopLevelPlan
-
getBuildDefinition
@NotNull @NotNull BuildDefinition getBuildDefinition()
- Returns:
- BuildDefinition associated with Plan this context relates to
-
getArtifactContext
@NotNull @NotNull ArtifactContext getArtifactContext()
- Specified by:
getArtifactContext
in interfaceCommonContext
- Returns:
- Artifact data associated with Plan
-
getBuildChanges
@NotNull @NotNull BuildChanges getBuildChanges()
Returns the build changes, if any, that represents the changes that triggered this build.- 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
void setBuildChanges(BuildChanges buildChanges)
-
getBuildResult
@NotNull @NotNull CurrentBuildResult getBuildResult()
The information about the results of a build- Returns:
CurrentBuildResult
-
getRelevantRepositoryIds
@NotNull @NotNull Set<Long> getRelevantRepositoryIds()
- 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 @NotNull Map<Long,String> getCheckoutLocation()
Map holds final checkout where repository was checked out by VcsCheckoutTask Elements are kept in order of checkout- Returns:
- map of repositoryId as Long and checkout location as String
-
isBranch
boolean isBranch()
Provides information if context refers to the branch of the Chain- Returns:
- true if context refers to the chain branch
-
isOnceOff
boolean isOnceOff()
Provides information if context refers to the "once-off" build - a build that have been run with customized revision- Returns:
- true if context refers to the chain branch
-
isCustomBuild
boolean isCustomBuild()
Provides information if context refers to the build that had some variables overwritten- Returns:
- true if context refers to the build with overwritten variables
-
getBandanaContext
@NotNull @NotNull BambooBandanaContext getBandanaContext()
BandanaContext of the plan.- Returns:
BandanaContext
of the plan
-
setVariableContext
void setVariableContext(@NotNull @NotNull VariableContext variableContext)
-
getMaximumBuildWarningsCount
long getMaximumBuildWarningsCount()
-
getMergeResult
@Nullable @Nullable MergeResultContext getMergeResult()
If a build performs merge, this method returns the result.- Since:
- 9.0
-
setMergeResult
void setMergeResult(@Nullable @Nullable MergeResultContext mergeResult)
- Since:
- 9.0
-
-