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 TypeMethodDescriptionvoiddetachBuildFromAgent(long agentId) Detaches runnin build (if any) from an agent that was assigned to it.voidexecute(@NotNull BuildContext buildContext) Executes the givenBuildContextAt this point aBuildResultsSummaryexists that matches the givenBuildContextvoidfinishBuild(@NotNull PlanResultKey planResultKey, boolean updateFollowingBuilds) Calls removeCurrentlyBuilding and finishProcessvoidfinishBuildWithCleanState(@NotNull PlanResultKey planResultKey, @Nullable BuildContext buildContext) Calls removeCurrentlyBuilding and finishProcess.@Nullable CurrentlyBuildinggetBuildRunningOnAgent(@NotNull Long buildAgentId) @NotNull List<CurrentlyBuilding>getCurrentlyBuilding(@NotNull Key key) @Nullable CurrentlyBuildinggetCurrentlyBuildingByBuildResult(@NotNull BuildIdentifier buildIdentifier) ReturnsCurrentlyBuildinginstance for build identifier (orBuildContext).@Nullable CurrentlyBuildinggetCurrentlyBuildingByPlanResultKey(@NotNull ResultKey resultKey) ReturnsCurrentlyBuildinginstance for build identified by buildResultKey.@NotNull Iterable<CurrentlyBuilding>Retrieves a all builds being executed (i.e not just queued).getCurrentlyExecuting(PlanKey planKey) @Nullable CurrentlyBuildingremoveCurrentlyBuilding(@NotNull ResultKey resultKey) voidsetCurrentlyBuilding(@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, @Nullable @Nullable 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 givenBuildContextAt this point aBuildResultsSummaryexists that matches the givenBuildContext- Parameters:
buildContext-
-
getCurrentlyBuildingByPlanResultKey
@Nullable @Nullable CurrentlyBuilding getCurrentlyBuildingByPlanResultKey(@NotNull @NotNull ResultKey resultKey) ReturnsCurrentlyBuildinginstance for build identified by buildResultKey. Should be used only ifBuildIdentifieris not available - basically in actions- Parameters:
resultKey-- Returns:
-
getCurrentlyBuildingByBuildResult
@Nullable @Nullable CurrentlyBuilding getCurrentlyBuildingByBuildResult(@NotNull @NotNull BuildIdentifier buildIdentifier) ReturnsCurrentlyBuildinginstance for build identifier (orBuildContext).- Parameters:
buildIdentifier-- Returns:
-