@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 executeBefore
and executeAfter
methods. Thanks to this,
you can store some data in executeBefore
and use it in executeAfter
.Modifier and Type | Method and Description |
---|---|
TaskResult |
executeAfter(InternalTaskType task,
TaskResult taskResult)
Executes a custom action after the task is executed.
|
void |
executeBefore(InternalTaskType task,
CommonTaskContext context)
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 failsTaskResult executeAfter(@NotNull InternalTaskType task, @Nullable TaskResult taskResult) throws Exception
task
- a current task which was executedtaskResult
- a result of a task execution; may be null
in case task terminated abnormallyException
- in case when a post-task action failsCopyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.