@ExperimentalApi public interface PrePostTaskActions extends BambooPluginModule
TaskType), a deployment task (com.atlassian.bamboo.deployments.execution.DeploymentTaskType, or a common task (
CommonTaskType) in a build or a deployment plan. This actions object will be handled by a task executor as stateful, which means that the same instance will be used to call
executeAftermethods. Thanks to this, you can store some data in
executeBeforeand use it in
|Modifier and Type||Method and Description|
Executes a custom action after the task is executed.
Executes a custom action before the task is executed.
void executeBefore(@NotNull InternalTaskType task, @NotNull CommonTaskContext context) throws Exception
task- a current task, it can be actually a subclass of TaskType (build plans), DeploymentTaskType (deployment plans) or CommonTaskType (build or deployment plans)
context- a current task context, can be actually a TaskContext (build plans) or DeploymentTaskContext (deployment plans), TODO can it be a CommonTaskContext? flow in TaskExecutorImpl suggests that it may happen - but under which conditions actually?
Exception- in case when a pre-task action fails
TaskResult executeAfter(@NotNull InternalTaskType task, @Nullable TaskResult taskResult) throws Exception
task- a current task which was executed
taskResult- a result of a task execution; may be
nullin case task terminated abnormally
Exception- in case when a post-task action fails
Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.