Package com.atlassian.bamboo.v2.build
Class BuildContextImpl
java.lang.Object
com.atlassian.bamboo.v2.build.BuildIdentifierImpl
com.atlassian.bamboo.v2.build.BuildContextImpl
- All Implemented Interfaces:
BuildContext
,BuildIdentifier
,CommonContext
,Serializable
- See Also:
-
Constructor Summary
ConstructorDescriptionBuildContextImpl
(BuildIdentifier identifier, TriggerReason triggerReason, BuildDefinition buildDefinition, @Nullable BuildChanges buildChanges, @Nullable BuildContext parentBuildContext, @Nullable ArtifactContext artifactContext, VariableContext variableContext, @Nullable Map<String, String> customBuildData, Map<Long, PlanRepositoryDefinition> planRepositoryDefinitionMap, Set<Long> relevantRepositoryIds, Map<Long, String> checkoutLocation, boolean isBranch, boolean isOnceOff, boolean isCustomBuild, boolean isVerboseLoggingOn, BambooBandanaContext bandanaContext, @NotNull Iterable<CredentialsData> relevantSharedCredentials, @NotNull Map<PlanKey, ChainStorageTag> relevantStorageTags, BuildKey buildKey, MergeResultContext mergeResult, boolean expectingCustomDedicatedAgent) Using this constructor directly is not recommended. -
Method Summary
Modifier and TypeMethodDescription@NotNull ArtifactContext
@NotNull BambooBandanaContext
BandanaContext of the plan.@NotNull BuildChanges
Returns the build changes, if any, that represents the changes that triggered this build.@NotNull BuildDefinition
@NotNull BuildKey
@NotNull CurrentBuildResult
The information about the results of a build@NotNull Map<PlanKey,
ChainStorageTag> Map holds final checkout where repository was checked out by VcsCheckoutTask Elements are kept in order of checkout@NotNull CurrentResult
A human friendly description of what is being built.@NotNull DockerPipelineConfiguration
Returns id of a group entity belongs to.long
@NotNull ErrorCollection
Any errors associated with the buildlong
If a build performs merge, this method returns the result.If this context is forImmutableJob
returns context of owner chain, null otherwise.@NotNull List<RuntimeTaskDefinition>
All tasks defined for this build.@NotNull Iterable<CredentialsData>
@NotNull TriggerReason
The reason this build was triggered@NotNull VariableContext
@NotNull List<PlanRepositoryDefinition>
@NotNull Map<Long,
PlanRepositoryDefinition> boolean
isBranch()
Provides information if context refers to the branch of the Chainboolean
Provides information if context refers to the build that had some variables overwrittenboolean
If this job is expected to be built on a custom dedicated agentboolean
Provides information if context refers to the "once-off" build - a build that have been run with customized revisionboolean
Controls the amount of logging during the execution.void
setBuildChanges
(BuildChanges buildChanges) void
setMergeResult
(MergeResultContext mergeResultSummary) void
setRelevantRepositories
(@NotNull Set<RepositoryDefinition> relevantRepositories) void
setVariableContext
(VariableContext variableContext) Methods inherited from class com.atlassian.bamboo.v2.build.BuildIdentifierImpl
equals, getBuildNumber, getBuildResultKey, getMasterPlanId, getPlanDbId, getPlanId, getPlanKey, getPlanName, getPlanResultKey, getProjectName, getShortName, getTypedPlanKey, getUuid, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.bamboo.v2.build.BuildIdentifier
getBuildNumber, getBuildResultKey, getMasterPlanId, getPlanDbId, getPlanId, getPlanKey, getPlanName, getPlanResultKey, getProjectName, getShortName, getTypedPlanKey, getUuid
-
Constructor Details
-
BuildContextImpl
public BuildContextImpl(BuildIdentifier identifier, TriggerReason triggerReason, BuildDefinition buildDefinition, @Nullable @Nullable BuildChanges buildChanges, @Nullable @Nullable BuildContext parentBuildContext, @Nullable @Nullable ArtifactContext artifactContext, VariableContext variableContext, @Nullable @Nullable Map<String, String> customBuildData, Map<Long, PlanRepositoryDefinition> planRepositoryDefinitionMap, Set<Long> relevantRepositoryIds, Map<Long, String> checkoutLocation, boolean isBranch, boolean isOnceOff, boolean isCustomBuild, boolean isVerboseLoggingOn, BambooBandanaContext bandanaContext, @NotNull @NotNull Iterable<CredentialsData> relevantSharedCredentials, @NotNull @NotNull Map<PlanKey, ChainStorageTag> relevantStorageTags, BuildKey buildKey, MergeResultContext mergeResult, boolean expectingCustomDedicatedAgent) Using this constructor directly is not recommended. UseBuildContextBuilder
instead.
-
-
Method Details
-
getBuildKey
- Specified by:
getBuildKey
in interfaceCommonContext
-
getParentBuildIdentifier
- Specified by:
getParentBuildIdentifier
in interfaceBuildIdentifier
- Overrides:
getParentBuildIdentifier
in classBuildIdentifierImpl
- Returns:
- the
BuildContext
of the parentPlan
execution. Should return null if the currentBuildContext
is for aChain
-
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
-
getTriggerReason
Description copied from interface:CommonContext
The reason this build was triggered- Specified by:
getTriggerReason
in interfaceCommonContext
- Returns:
- triggerReason
-
getBuildDefinition
- Specified by:
getBuildDefinition
in interfaceBuildContext
- Returns:
- BuildDefinition associated with Plan this context relates to
-
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
- Specified by:
setBuildChanges
in interfaceBuildContext
-
getBuildResult
Description copied from interface:BuildContext
The information about the results of a build- Specified by:
getBuildResult
in interfaceBuildContext
- Returns:
CurrentBuildResult
-
getCurrentResult
- Specified by:
getCurrentResult
in interfaceCommonContext
-
getArtifactContext
- Specified by:
getArtifactContext
in interfaceBuildContext
- Specified by:
getArtifactContext
in interfaceCommonContext
- Returns:
- Artifact data associated with Plan
-
getVariableContext
- Specified by:
getVariableContext
in interfaceCommonContext
-
getVcsRepositories
- Specified by:
getVcsRepositories
in interfaceCommonContext
-
getVcsRepositoryMap
- Specified by:
getVcsRepositoryMap
in interfaceCommonContext
-
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.
-
getBandanaContext
Description copied from interface:BuildContext
BandanaContext of the plan.- Specified by:
getBandanaContext
in interfaceBuildContext
- Returns:
BandanaContext
of the plan
-
getErrorCollection
Description copied from interface:CommonContext
Any errors associated with the build- Specified by:
getErrorCollection
in interfaceCommonContext
-
setRelevantRepositories
public void setRelevantRepositories(@NotNull @NotNull Set<RepositoryDefinition> relevantRepositories) -
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
-
getEntityKey
- Specified by:
getEntityKey
in interfaceCommonContext
-
getResultKey
- Specified by:
getResultKey
in interfaceCommonContext
-
getDisplayName
Description copied from interface:CommonContext
A human friendly description of what is being built.- Specified by:
getDisplayName
in interfaceCommonContext
- Returns:
-
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
-
getEntityId
public long getEntityId()- Specified by:
getEntityId
in interfaceCommonContext
-
getChainStorageTags
- Specified by:
getChainStorageTags
in interfaceCommonContext
-
setVariableContext
- Specified by:
setVariableContext
in interfaceBuildContext
-
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.
-
getDockerPipelineConfiguration
- Specified by:
getDockerPipelineConfiguration
in interfaceCommonContext
-
getMaximumBuildWarningsCount
public long getMaximumBuildWarningsCount()- Specified by:
getMaximumBuildWarningsCount
in interfaceBuildContext
-
getMergeResult
Description copied from interface:BuildContext
If a build performs merge, this method returns the result.- Specified by:
getMergeResult
in interfaceBuildContext
-
setMergeResult
- Specified by:
setMergeResult
in interfaceBuildContext
-
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
-