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
ConstructorsConstructorDescriptionBuildContextImpl(BuildIdentifier identifier, TriggerReason triggerReason, @NotNull 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 BambooBandanaContextBandanaContext of the plan.@NotNull BuildChangesReturns the build changes, if any, that represents the changes that triggered this build.@NotNull BuildDefinition@NotNull BuildKey@NotNull CurrentBuildResultThe 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 CurrentResultA human friendly description of what is being built.@NotNull DockerPipelineConfigurationReturns id of a group entity belongs to.long@NotNull ErrorCollectionAny errors associated with the buildlongIf a build performs merge, this method returns the result.If this context is forImmutableJobreturns context of owner chain, null otherwise.@NotNull List<RuntimeTaskDefinition> All tasks defined for this build.@NotNull Iterable<CredentialsData> @NotNull TriggerReasonThe reason this build was triggered@NotNull VariableContext@NotNull List<PlanRepositoryDefinition> @NotNull Map<Long, PlanRepositoryDefinition> booleanisBranch()Provides information if context refers to the branch of the ChainbooleanProvides information if context refers to the build that had some variables overwrittenbooleanIf this job is expected to be built on a custom dedicated agentbooleanProvides information if context refers to the "once-off" build - a build that have been run with customized revisionbooleanControls the amount of logging during the execution.voidsetBuildChanges(BuildChanges buildChanges) voidsetMergeResult(MergeResultContext mergeResultSummary) voidsetVariableContext(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, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods 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, @NotNull @NotNull 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. UseBuildContextBuilderinstead.
-
-
Method Details
-
getBuildKey
- Specified by:
getBuildKeyin interfaceCommonContext
-
getParentBuildIdentifier
- Specified by:
getParentBuildIdentifierin interfaceBuildIdentifier- Overrides:
getParentBuildIdentifierin classBuildIdentifierImpl- Returns:
- the
BuildContextof the parentPlanexecution. Should return null if the currentBuildContextis for aChain
-
getParentBuildContext
Description copied from interface:BuildContextIf this context is forImmutableJobreturns context of owner chain, null otherwise. Note: modifying parent context by job-level actions, such asPreJobActionis not thread safe and is not supported.- Specified by:
getParentBuildContextin interfaceBuildContext- Returns:
- the
BuildContextof the parentPlanexecution. Should return null if the currentBuildContextis for aTopLevelPlan
-
getTriggerReason
Description copied from interface:CommonContextThe reason this build was triggered- Specified by:
getTriggerReasonin interfaceCommonContext- Returns:
- triggerReason
-
getBuildDefinition
- Specified by:
getBuildDefinitionin interfaceBuildContext- Returns:
- BuildDefinition associated with Plan this context relates to
-
getBuildChanges
Description copied from interface:BuildContextReturns the build changes, if any, that represents the changes that triggered this build.- Specified by:
getBuildChangesin 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:
setBuildChangesin interfaceBuildContext
-
getBuildResult
Description copied from interface:BuildContextThe information about the results of a build- Specified by:
getBuildResultin interfaceBuildContext- Returns:
CurrentBuildResult
-
getCurrentResult
- Specified by:
getCurrentResultin interfaceCommonContext
-
getArtifactContext
- Specified by:
getArtifactContextin interfaceBuildContext- Specified by:
getArtifactContextin interfaceCommonContext- Returns:
- Artifact data associated with Plan
-
getVariableContext
- Specified by:
getVariableContextin interfaceCommonContext
-
getVcsRepositories
- Specified by:
getVcsRepositoriesin interfaceCommonContext
-
getVcsRepositoryMap
- Specified by:
getVcsRepositoryMapin interfaceCommonContext
-
getCheckoutLocation
Description copied from interface:BuildContextMap holds final checkout where repository was checked out by VcsCheckoutTask Elements are kept in order of checkout- Specified by:
getCheckoutLocationin interfaceBuildContext- Returns:
- map of repositoryId as Long and checkout location as String
-
isBranch
public boolean isBranch()Description copied from interface:BuildContextProvides information if context refers to the branch of the Chain- Specified by:
isBranchin interfaceBuildContext- Returns:
- true if context refers to the chain branch
-
isOnceOff
public boolean isOnceOff()Description copied from interface:BuildContextProvides information if context refers to the "once-off" build - a build that have been run with customized revision- Specified by:
isOnceOffin interfaceBuildContext- Returns:
- true if context refers to the chain branch
-
isCustomBuild
public boolean isCustomBuild()Description copied from interface:BuildContextProvides information if context refers to the build that had some variables overwritten- Specified by:
isCustomBuildin interfaceBuildContext- Returns:
- true if context refers to the build with overwritten variables
-
isVerboseLoggingOn
public boolean isVerboseLoggingOn()Description copied from interface:CommonContextControls the amount of logging during the execution. Some of the logging is only output in verbose mode.- Specified by:
isVerboseLoggingOnin interfaceCommonContext- Returns:
- true if verbose logging is enabled.
-
getBandanaContext
Description copied from interface:BuildContextBandanaContext of the plan.- Specified by:
getBandanaContextin interfaceBuildContext- Returns:
BandanaContextof the plan
-
getErrorCollection
Description copied from interface:CommonContextAny errors associated with the build- Specified by:
getErrorCollectionin interfaceCommonContext
-
getRelevantRepositoryIds
- Specified by:
getRelevantRepositoryIdsin 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:
getEntityKeyin interfaceCommonContext
-
getResultKey
- Specified by:
getResultKeyin interfaceCommonContext
-
getDisplayName
Description copied from interface:CommonContextA human friendly description of what is being built.- Specified by:
getDisplayNamein interfaceCommonContext- Returns:
-
getRuntimeTaskDefinitions
Description copied from interface:CommonContextAll tasks defined for this build. Contains both regular tasks and finalising tasks.- Specified by:
getRuntimeTaskDefinitionsin interfaceCommonContext- Returns:
- A
ListofRuntimeTaskDefinitions
-
getEntityId
public long getEntityId()- Specified by:
getEntityIdin interfaceCommonContext
-
getChainStorageTags
- Specified by:
getChainStorageTagsin interfaceCommonContext
-
setVariableContext
- Specified by:
setVariableContextin interfaceBuildContext
-
getEntityGroupId
Description copied from interface:CommonContextReturns id of a group entity belongs to. E.g. returns deployment project's id if entity is a deployment environment.- Specified by:
getEntityGroupIdin interfaceCommonContext- Returns:
- id of entity group or null if not applicable.
-
getDockerPipelineConfiguration
- Specified by:
getDockerPipelineConfigurationin interfaceCommonContext
-
getMaximumBuildWarningsCount
public long getMaximumBuildWarningsCount()- Specified by:
getMaximumBuildWarningsCountin interfaceBuildContext
-
getMergeResult
Description copied from interface:BuildContextIf a build performs merge, this method returns the result.- Specified by:
getMergeResultin interfaceBuildContext
-
setMergeResult
- Specified by:
setMergeResultin interfaceBuildContext
-
isExpectingCustomDedicatedAgent
public boolean isExpectingCustomDedicatedAgent()Description copied from interface:CommonContextIf this job is expected to be built on a custom dedicated agent- Specified by:
isExpectingCustomDedicatedAgentin interfaceCommonContext
-