-
- All Implemented Interfaces:
-
com.netflix.spinnaker.kork.plugins.api.internal.SpinnakerExtensionPoint,org.pf4j.ExtensionPoint
@Beta() public interface StageDefinitionBuilder implements SpinnakerExtensionPointProvides a low-level API for building stages.
A stage in its simplest form will consist of a series of Tasks that are executed serially. However, a stage can also configure other stages to be run before it, or after it, and or on failure only. This can enable you to build stages which compose and abstract the details of other stages.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description @interfaceStageDefinitionBuilder.AliasesAllows backwards compatibility of a stage's "type", even through class renames / refactors.
-
Method Summary
Modifier and Type Method Description TaskNode.TaskGraphbuildTaskGraph(StageExecution stage)voidtaskGraph(StageExecution stage, TaskNode.Builder builder)Implement this method to define any tasks that should run as part of this stage's workflow. voidbeforeStages(StageExecution parent, StageGraphBuilder graph)Implement this method to define any stages that should run before any tasks in this stage as part of a composed workflow. voidafterStages(StageExecution parent, StageGraphBuilder graph)Implement this method to define any stages that should run after any tasks in this stage as part of a composed workflow. voidonFailureStages(StageExecution stage, StageGraphBuilder graph)Implement this method to define any stages that should run in response to a failure in tasks, before or after stages. StringgetType()Returns the stage type this builder handles. voidprepareStageForRestart(StageExecution stage)Implementations can override this if they need any special cleanup on restart. static StringgetType(Class<out StageDefinitionBuilder> clazz)Get the pipeline configuration-friendly type name for this stage. booleancanManuallySkip(StageExecution stage)Return true if the stage can be manually skipped from the API. Collection<String>aliases()A collection of known aliases. -
-
Method Detail
-
buildTaskGraph
@Nonnull() TaskNode.TaskGraph buildTaskGraph(StageExecution stage)
-
taskGraph
void taskGraph(StageExecution stage, TaskNode.Builder builder)
Implement this method to define any tasks that should run as part of this stage's workflow.
- Parameters:
stage- The execution runtime of the stagebuilder- The task graph builder
-
beforeStages
void beforeStages(StageExecution parent, StageGraphBuilder graph)
Implement this method to define any stages that should run before any tasks in this stage as part of a composed workflow.
- Parameters:
parent- The execution runtime of the stage (which is the parent of any stages created herein)graph- The stage graph builder
-
afterStages
void afterStages(StageExecution parent, StageGraphBuilder graph)
Implement this method to define any stages that should run after any tasks in this stage as part of a composed workflow.
- Parameters:
parent- The execution runtime of the stage (which is the parent of any stages created herein)graph- The stage graph builder
-
onFailureStages
void onFailureStages(StageExecution stage, StageGraphBuilder graph)
Implement this method to define any stages that should run in response to a failure in tasks, before or after stages.
- Parameters:
stage- The execution runtime of the stagegraph- The stage graph builder
-
prepareStageForRestart
void prepareStageForRestart(StageExecution stage)
Implementations can override this if they need any special cleanup on restart.
- Parameters:
stage- The execution runtime of the stage
-
getType
static String getType(Class<out StageDefinitionBuilder> clazz)
Get the pipeline configuration-friendly type name for this stage.
If a stage class is
{@code MyFancyStage}, the resulting type would be{@code myFancy}.- Parameters:
clazz- The stage definition builder class
-
canManuallySkip
boolean canManuallySkip(StageExecution stage)
Return true if the stage can be manually skipped from the API.
-
aliases
Collection<String> aliases()
A collection of known aliases.
-
-
-
-