Package com.atlassian.bamboo.build
Interface BuildExecutionManager
- All Known Implementing Classes:
DefaultBuildExecutionManager
@ThreadSafe
public interface BuildExecutionManager
A class that is aware of all the goings on in executing builds.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
detachBuildFromAgent
(long agentId) Detaches runnin build (if any) from an agent that was assigned to it.void
execute
(@NotNull BuildContext buildContext) Executes the givenBuildContext
At this point aBuildResultsSummary
exists that matches the givenBuildContext
void
finishBuild
(@NotNull PlanResultKey planResultKey, boolean updateFollowingBuilds) Calls removeCurrentlyBuilding and finishProcessvoid
finishBuildWithCleanState
(@NotNull PlanResultKey planResultKey, @NotNull BuildContext buildContext) Calls removeCurrentlyBuilding and finishProcess.@Nullable CurrentlyBuilding
getBuildRunningOnAgent
(@NotNull Long buildAgentId) @NotNull List<CurrentlyBuilding>
getCurrentlyBuilding
(@NotNull Key key) @Nullable CurrentlyBuilding
getCurrentlyBuildingByBuildResult
(@NotNull BuildIdentifier buildIdentifier) ReturnsCurrentlyBuilding
instance for build identifier (orBuildContext
).@Nullable CurrentlyBuilding
getCurrentlyBuildingByPlanResultKey
(@NotNull ResultKey resultKey) ReturnsCurrentlyBuilding
instance for build identified by buildResultKey.@NotNull Iterable<CurrentlyBuilding>
Retrieves a all builds being executed (i.e not just queued).getCurrentlyExecuting
(PlanKey planKey) @Nullable CurrentlyBuilding
removeCurrentlyBuilding
(@NotNull ResultKey resultKey) void
setCurrentlyBuilding
(@NotNull BuildContext buildContext, @NotNull Collection<BuildAgent> executableAgents, @NotNull Collection<ElasticImageConfiguration> executableImages) Denotes that the passed build context is beginning the build process.
-
Method Details
-
getCurrentlyExecuting
Retrieves a all builds being executed (i.e not just queued).- Returns:
-
getCurrentlyExecuting
-
getCurrentlyBuilding
-
removeCurrentlyBuilding
@Nullable @Nullable CurrentlyBuilding removeCurrentlyBuilding(@NotNull @NotNull ResultKey resultKey) -
setCurrentlyBuilding
void setCurrentlyBuilding(@NotNull @NotNull BuildContext buildContext, @NotNull @NotNull Collection<BuildAgent> executableAgents, @NotNull @NotNull Collection<ElasticImageConfiguration> executableImages) Denotes that the passed build context is beginning the build process. (i.e. it's being queued)- Parameters:
buildContext
- -executableAgents
- - a list of agents on which this build can be run.executableImages
- - a list of images on which the build can be run.
-
getBuildRunningOnAgent
-
finishBuildWithCleanState
void finishBuildWithCleanState(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull BuildContext buildContext) Calls removeCurrentlyBuilding and finishProcess. This method assumes that result's life cycle state has been updated correctly. If in doubt use#finishBuild(PlanResultKey)
instead.- Parameters:
planResultKey
- identifies plan result
-
finishBuild
Calls removeCurrentlyBuilding and finishProcess- Parameters:
planResultKey
- identifies plan resultupdateFollowingBuilds
-
-
detachBuildFromAgent
void detachBuildFromAgent(long agentId) Detaches runnin build (if any) from an agent that was assigned to it. Makes it possible for orphaned build monitor to clean it up. On the other hand, if the build result is returned within grace period it can still be accepted.- Since:
- 8.0
-
execute
Executes the givenBuildContext
At this point aBuildResultsSummary
exists that matches the givenBuildContext
- Parameters:
buildContext
-
-
getCurrentlyBuildingByPlanResultKey
@Nullable @Nullable CurrentlyBuilding getCurrentlyBuildingByPlanResultKey(@NotNull @NotNull ResultKey resultKey) ReturnsCurrentlyBuilding
instance for build identified by buildResultKey. Should be used only ifBuildIdentifier
is not available - basically in actions- Parameters:
resultKey
-- Returns:
-
getCurrentlyBuildingByBuildResult
@Nullable @Nullable CurrentlyBuilding getCurrentlyBuildingByBuildResult(@NotNull @NotNull BuildIdentifier buildIdentifier) ReturnsCurrentlyBuilding
instance for build identifier (orBuildContext
).- Parameters:
buildIdentifier
-- Returns:
-