workflow

package
v0.0.0-...-8192ee4 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2020 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandResult

type CommandResult struct {
	ContainerID string
	Command     []string
	StdOut      bytes.Buffer
	StdErr      bytes.Buffer
	ExitCode    int
	Error       error
}

type DockerError

type DockerError struct {
	Original error
}

DockerError occures when something went wrong with docker and we just want to pass back the original error, but with a fancy wrap. Most of them will be converted to other error types, but if any of them left in there, it will be a DockerError.

func (DockerError) Error

func (e DockerError) Error() string

type Job

type Job struct {
	Name        string
	Commands    [][]string
	Image       string
	StopOnError bool
	Environment []string

	Result *JobResult
}

Job is a single job executed in a workflow.

func (*Job) Run

func (job *Job) Run(ctx context.Context, client *docker.Client)

type JobResult

type JobResult struct {
	Commands []CommandResult
	Error    error
}

func (*JobResult) AddCommandResult

func (r *JobResult) AddCommandResult(command CommandResult)

type Workflow

type Workflow struct {
	Jobs []*Job
	// contains filtered or unexported fields
}

Workflow is a series of Jobs.

func NewWorkflow

func NewWorkflow(cli *client.Client) Workflow

NewWorkflow creates a new workflow.

func (*Workflow) AddJob

func (workflow *Workflow) AddJob(job *Job)

func (*Workflow) Execute

func (workflow *Workflow) Execute(ctx context.Context)

Execute the workflow.

Jump to

Keyboard shortcuts

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