Package com.atlassian.bamboo.chains
Class BuildContextFactoryImpl
java.lang.Object
com.atlassian.bamboo.chains.BuildContextFactoryImpl
- All Implemented Interfaces:
BuildContextFactory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull BuildRepositoryChanges
buildChangesUnion
(@NotNull BuildRepositoryChanges a, @NotNull BuildRepositoryChanges b) boolean
canRestartOrContinueBuild
(@NotNull ImmutableChain chain, @NotNull ChainResultsSummary chainResultsSummary, @NotNull PlanExecutionConfig planExecutionConfig) Checks if build can be continued from a manual stage or restarted, that is, if there are any stages to be run and if all the jobs in those stages still exist.@NotNull Map<ImmutableChainStage,
Map<ImmutableJob, BuildContext>> createBuildContextsForJobs
(@NotNull ImmutableChain chain, @NotNull ChainResultsSummary chainResultsSummary, @NotNull BuildContext parentBuildContext, @NotNull PlanExecutionConfig planExecutionConfig) @NotNull Map<ImmutableChainStage,
Map<ImmutableJob, BuildContext>> createBuildContextsForJobs
(@NotNull ImmutableChain chain, @NotNull BuildContext parentBuildContext) @NotNull Collection<BuildContext>
createBuildContextsForRestartedOrContinuedBuild
(@NotNull ImmutableChain chain, @NotNull ChainResultsSummary chainResultsSummary, @NotNull BuildContext parentBuildContext, @NotNull PlanExecutionConfig planExecutionConfig) Creates aBuildContext
for each not built or failedJob
in theChain
that was partially executed or is restarted for example with "continue manual stage" action, or "re-run failed jobs" action, etcvoid
updateBuildContextWithChanges
(BuildContext contextToUpdate, BuildChanges newBuildChanges) Updates the build context with build changes
-
Constructor Details
-
BuildContextFactoryImpl
public BuildContextFactoryImpl()
-
-
Method Details
-
createBuildContextsForJobs
@NotNull public @NotNull Map<ImmutableChainStage,Map<ImmutableJob, createBuildContextsForJobsBuildContext>> (@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull BuildContext parentBuildContext) Description copied from interface:BuildContextFactory
- Specified by:
createBuildContextsForJobs
in interfaceBuildContextFactory
parentBuildContext
- - buildContext of the parent chain execution- Returns:
- map of
Job
PlanKey
s to theirBuildContext
-
updateBuildContextWithChanges
public void updateBuildContextWithChanges(BuildContext contextToUpdate, BuildChanges newBuildChanges) Description copied from interface:BuildContextFactory
Updates the build context with build changes- Specified by:
updateBuildContextWithChanges
in interfaceBuildContextFactory
-
canRestartOrContinueBuild
public boolean canRestartOrContinueBuild(@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull ChainResultsSummary chainResultsSummary, @NotNull @NotNull PlanExecutionConfig planExecutionConfig) Description copied from interface:BuildContextFactory
Checks if build can be continued from a manual stage or restarted, that is, if there are any stages to be run and if all the jobs in those stages still exist.- Specified by:
canRestartOrContinueBuild
in interfaceBuildContextFactory
-
createBuildContextsForJobs
@NotNull public @NotNull Map<ImmutableChainStage,Map<ImmutableJob, createBuildContextsForJobsBuildContext>> (@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull ChainResultsSummary chainResultsSummary, @NotNull @NotNull BuildContext parentBuildContext, @NotNull @NotNull PlanExecutionConfig planExecutionConfig) Description copied from interface:BuildContextFactory
- Specified by:
createBuildContextsForJobs
in interfaceBuildContextFactory
-
createBuildContextsForRestartedOrContinuedBuild
@NotNull public @NotNull Collection<BuildContext> createBuildContextsForRestartedOrContinuedBuild(@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull ChainResultsSummary chainResultsSummary, @NotNull @NotNull BuildContext parentBuildContext, @NotNull @NotNull PlanExecutionConfig planExecutionConfig) Description copied from interface:BuildContextFactory
Creates aBuildContext
for each not built or failedJob
in theChain
that was partially executed or is restarted for example with "continue manual stage" action, or "re-run failed jobs" action, etc- Specified by:
createBuildContextsForRestartedOrContinuedBuild
in interfaceBuildContextFactory
chainResultsSummary
- - existingChainResultsSummary
for build to continue/restartparentBuildContext
- -Chain
BuildContext
planExecutionConfig
- - controls build continuation or restart- Returns:
- collection of
BuildContext
to execute
-
buildChangesUnion
@NotNull public @NotNull BuildRepositoryChanges buildChangesUnion(@NotNull @NotNull BuildRepositoryChanges a, @NotNull @NotNull BuildRepositoryChanges b) - Specified by:
buildChangesUnion
in interfaceBuildContextFactory
-