actions

package
v2.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	// contains filtered or unexported fields
}

func NewAction

func NewAction(name string, timeoutSeconds int, isFailFast bool, tasks []Task) *Action

func (Action) Cleanup

func (a Action) Cleanup(ctx context.Context, out io.Writer) error

func (Action) Exec

func (a Action) Exec(ctx context.Context, out io.Writer) error

func (Action) Name

func (a Action) Name() string

type ExecEnv

type ExecEnv interface {
	// PrepareActions creates the shared resources needed for the actions of an
	// specific execution mode. It returns the actions of this execution mode.
	PrepareActions(ctx context.Context, out io.Writer, allbuilds, localImgs []graph.Artifact, acsNames []string) ([]Action, error)

	// Cleanup frees the shared resources created during PrepareActions.
	Cleanup(ctx context.Context, out io.Writer) error

	// Stop stops any ongoing task started in the execution env necessary to run the tasks.
	Stop()
}

ExecEnv represents every execution mode available for custom actions.

type ExecStrategy

type ExecStrategy func(ctx context.Context, out io.Writer, ts []Task) error

ExecStrategy represents the functions to use to execute a list of tasks.

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(execEnvByAction map[string]ExecEnv, orderedExecEnvs []ExecEnv, acsByExecEnv map[ExecEnv][]string) Runner

func (Runner) Exec

func (r Runner) Exec(ctx context.Context, out io.Writer, allbuilds, localImgs []graph.Artifact, aName string) error

func (Runner) ExecAll

func (r Runner) ExecAll(ctx context.Context, out io.Writer, allbuilds, localImgs []graph.Artifact) error

type Task

type Task interface {
	// Name is the unique name of the tasks across all other tasks and actions.
	Name() string

	// Exec triggers the execution of the task.
	Exec(ctx context.Context, out io.Writer) error

	// Cleanup frees the resources created by the task to execute itself.
	Cleanup(ctx context.Context, out io.Writer) error
}

Task represents a single container from a custom action.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL