Class DeploymentExecutionServiceImpl
- java.lang.Object
-
- com.atlassian.bamboo.deployments.execution.service.DeploymentExecutionServiceImpl
-
- All Implemented Interfaces:
DeploymentExecutionService
public class DeploymentExecutionServiceImpl extends Object implements DeploymentExecutionService
-
-
Constructor Summary
Constructors Constructor Description DeploymentExecutionServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExecutionRequestResult
execute(Environment environment, @NotNull EnvironmentTriggeringAction action)
Start DeploymentContext execution.boolean
isEnvironmentBeingDeployedTo(long environmentId)
Check if Environment is currently being deployed tovoid
onBuildExecuted(OutOfBandBuildTimingPoints.SentToAgent timingPoint)
void
onDeploymentExecuted(OutOfBandDeploymentTimingPoints.SentToAgent timingPoint)
void
onDeploymentExecutionStarted(OutOfBandDeploymentTimingPoints.ExecutionStarted timingPoint)
void
onDeploymentFinished(DeploymentTimingPoints.ExecutionFinished timingPoint)
void
onDeploymentQueued(OutOfBandDeploymentTimingPoints.Queued timingPoint)
void
onDeploymentTriggered(@NotNull DeploymentTriggeredEvent event)
void
onEnvironmentsDeleted(@NotNull MultipleEnvironmentsDeletedEvent environmentsDeletedEvent)
DeploymentContext
prepareDeploymentContext(@NotNull Environment environment, @NotNull DeploymentVersion deploymentVersion, @NotNull TriggerReason triggerReason)
Prepare DeploymentContext out of Environment and DeploymentVersionDeploymentContext
prepareDeploymentContext(@NotNull Environment environment, @NotNull DeploymentVersion deploymentVersion, @NotNull TriggerReason triggerReason, @org.jetbrains.annotations.NotNull boolean isVerboseLoggingOn)
Prepare DeploymentContext out of Environment and DeploymentVersionvoid
processDeploymentResult(@NotNull DeploymentContext deploymentContext)
Process result that has come back from the agent.void
restoreStateOfResult(@NotNull DeploymentResult deploymentResult)
Restores internal state of single deployment result after server restart.void
stop(long environmentId)
Stops the execution of a deployment running on an Environment.void
stop(@NotNull DeploymentResult deploymentResult, Long agentId)
Stops the execution of a running deploymentvoid
stopBeforeDeletion(long environmentId)
Stops the execution of a deployment running on an Environment before deleting it.void
terminateDeployment(@NotNull DeploymentResultKey resultKey)
Cleans up deployment result if execution has been terminated abrubtly.
-
-
-
Method Detail
-
prepareDeploymentContext
public DeploymentContext prepareDeploymentContext(@NotNull @NotNull Environment environment, @NotNull @NotNull DeploymentVersion deploymentVersion, @NotNull @NotNull TriggerReason triggerReason) throws DeploymentDoesNotSatisfyPrerequisitesException
Description copied from interface:DeploymentExecutionService
Prepare DeploymentContext out of Environment and DeploymentVersion- Specified by:
prepareDeploymentContext
in interfaceDeploymentExecutionService
- Throws:
DeploymentDoesNotSatisfyPrerequisitesException
- if prerequisites needed to launch the deployment are not satisfied
-
prepareDeploymentContext
public DeploymentContext prepareDeploymentContext(@NotNull @NotNull Environment environment, @NotNull @NotNull DeploymentVersion deploymentVersion, @NotNull @NotNull TriggerReason triggerReason, @NotNull @org.jetbrains.annotations.NotNull boolean isVerboseLoggingOn) throws DeploymentDoesNotSatisfyPrerequisitesException
Description copied from interface:DeploymentExecutionService
Prepare DeploymentContext out of Environment and DeploymentVersion- Specified by:
prepareDeploymentContext
in interfaceDeploymentExecutionService
- Throws:
DeploymentDoesNotSatisfyPrerequisitesException
- if prerequisites needed to launch the deployment are not satisfied
-
execute
public ExecutionRequestResult execute(Environment environment, @NotNull @NotNull EnvironmentTriggeringAction action)
Description copied from interface:DeploymentExecutionService
Start DeploymentContext execution. Before putting DeploymentContext into execution pipeline this method checks if Environment is not running any other deployment.- Specified by:
execute
in interfaceDeploymentExecutionService
-
stop
public void stop(long environmentId)
Description copied from interface:DeploymentExecutionService
Stops the execution of a deployment running on an Environment.- Specified by:
stop
in interfaceDeploymentExecutionService
- Parameters:
environmentId
- id of the Environment
-
stopBeforeDeletion
public void stopBeforeDeletion(long environmentId)
Description copied from interface:DeploymentExecutionService
Stops the execution of a deployment running on an Environment before deleting it.- Specified by:
stopBeforeDeletion
in interfaceDeploymentExecutionService
- Parameters:
environmentId
- id of the Environment
-
stop
public void stop(@NotNull @NotNull DeploymentResult deploymentResult, Long agentId)
Description copied from interface:DeploymentExecutionService
Stops the execution of a running deployment- Specified by:
stop
in interfaceDeploymentExecutionService
- Parameters:
deploymentResult
- of the deployment we want to stopagentId
- agent on which the deployment is running
-
terminateDeployment
public void terminateDeployment(@NotNull @NotNull DeploymentResultKey resultKey)
Description copied from interface:DeploymentExecutionService
Cleans up deployment result if execution has been terminated abrubtly.- Specified by:
terminateDeployment
in interfaceDeploymentExecutionService
-
processDeploymentResult
public void processDeploymentResult(@NotNull @NotNull DeploymentContext deploymentContext)
Description copied from interface:DeploymentExecutionService
Process result that has come back from the agent.- Specified by:
processDeploymentResult
in interfaceDeploymentExecutionService
- Parameters:
deploymentContext
- from the agent.
-
isEnvironmentBeingDeployedTo
public boolean isEnvironmentBeingDeployedTo(long environmentId)
Description copied from interface:DeploymentExecutionService
Check if Environment is currently being deployed to- Specified by:
isEnvironmentBeingDeployedTo
in interfaceDeploymentExecutionService
- Parameters:
environmentId
- id of the Environment- Returns:
- true if
-
restoreStateOfResult
public void restoreStateOfResult(@NotNull @NotNull DeploymentResult deploymentResult)
Description copied from interface:DeploymentExecutionService
Restores internal state of single deployment result after server restart.- Specified by:
restoreStateOfResult
in interfaceDeploymentExecutionService
- Parameters:
deploymentResult
- a restored result
-
onDeploymentFinished
@EventListener public void onDeploymentFinished(@NotNull DeploymentTimingPoints.ExecutionFinished timingPoint)
-
onDeploymentTriggered
@EventListener public void onDeploymentTriggered(@NotNull @NotNull DeploymentTriggeredEvent event)
-
onDeploymentQueued
@EventListener public void onDeploymentQueued(@NotNull OutOfBandDeploymentTimingPoints.Queued timingPoint)
-
onDeploymentExecuted
@EventListener public void onDeploymentExecuted(@NotNull OutOfBandDeploymentTimingPoints.SentToAgent timingPoint)
-
onBuildExecuted
@EventListener public void onBuildExecuted(@NotNull OutOfBandBuildTimingPoints.SentToAgent timingPoint)
-
onDeploymentExecutionStarted
@EventListener public void onDeploymentExecutionStarted(@NotNull OutOfBandDeploymentTimingPoints.ExecutionStarted timingPoint)
-
onEnvironmentsDeleted
@EventListener public void onEnvironmentsDeleted(@NotNull @NotNull MultipleEnvironmentsDeletedEvent environmentsDeletedEvent)
-
-