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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
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>
getCurrentlyExecuting()
Retrieves a all builds being executed (i.e not just queued).Iterable<CurrentlyBuilding>
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 Detail
-
getCurrentlyExecuting
@NotNull @NotNull Iterable<CurrentlyBuilding> getCurrentlyExecuting()
Retrieves a all builds being executed (i.e not just queued).- Returns:
-
getCurrentlyExecuting
Iterable<CurrentlyBuilding> getCurrentlyExecuting(PlanKey planKey)
-
getCurrentlyBuilding
@NotNull @NotNull List<CurrentlyBuilding> getCurrentlyBuilding(@NotNull @NotNull Key key)
-
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
@Nullable @Nullable CurrentlyBuilding getBuildRunningOnAgent(@NotNull @NotNull Long buildAgentId)
-
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
void finishBuild(@NotNull @NotNull PlanResultKey planResultKey, boolean updateFollowingBuilds)
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
void execute(@NotNull @NotNull BuildContext buildContext)
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:
-
-