Package 

Interface StageDefinitionBuilder

  • All Implemented Interfaces:
    com.netflix.spinnaker.kork.plugins.api.internal.SpinnakerExtensionPoint , org.pf4j.ExtensionPoint

    @Beta() 
    public interface StageDefinitionBuilder
     implements SpinnakerExtensionPoint
                        

    Provides 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.

    • Method Detail

      • 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 stage
        builder - 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 stage
        graph - 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