Version: v0.7.2 Latest Latest

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

Go to latest
Published: Feb 13, 2020 License: MIT Imports: 25 Imported by: 0



Package batch implements batch execution.



View Source
const (
	// EnvironmentDeployment is used when an environment is deployed.
	EnvironmentDeployment = EnvironmentSetupType("deployment")
	// EnvironmentInitialization is used when an environment is initialized.
	// Initialization occurs after deployment.
	EnvironmentInitialization = EnvironmentSetupType("initialization")


This section is empty.


func RunBatch

func RunBatch(
	ctx context.Context,
	cfg *config.Config,
	batch *batches.Batch,
	options *RunBatchOptions,
	k8sClient *k8s.K8s,
) error

RunBatch runs a batch of commands against stacks.


type CommandInfo

type CommandInfo struct {
	BatchID string
	Name    string
	Tries   int

CommandInfo describes a batch command for reporting purposes.

type CommandResult

type CommandResult struct {
	Err       *string
	Started   time.Time
	Completed time.Time

CommandResult gives the result of a command, for reporting purposes.

type EnvironmentInfo

type EnvironmentInfo struct {
	BatchID      string
	StackName    string
	PipelinePath string

EnvironmentInfo gives info on an environment a batch command executed with.

type EnvironmentSetupResult

type EnvironmentSetupResult struct {
	SetupType EnvironmentSetupType
	Err       *string
	Started   time.Time
	Completed time.Time

EnvironmentSetupResult contains the result of setting up an environment.

type EnvironmentSetupType

type EnvironmentSetupType string

EnvironmentSetupType is the type of environment setup for EnvironmentSetupResult.

type NoopReporter

type NoopReporter struct{}

NoopReporter is a no-op reporter.

func (*NoopReporter) CommandOutput

func (reporter *NoopReporter) CommandOutput(info *CommandInfo) (io.WriteCloser, error)

CommandOutput implements Reporter.

func (*NoopReporter) CommandResult

func (reporter *NoopReporter) CommandResult(result *CommandResult)

CommandResult implements Reporter.

func (*NoopReporter) EnvironmentSetupResult

func (reporter *NoopReporter) EnvironmentSetupResult(result *EnvironmentSetupResult)

EnvironmentSetupResult implements Reporter.

func (*NoopReporter) Finalize

func (reporter *NoopReporter) Finalize() error

Finalize implements Reporter.

type Reporter

type Reporter interface {
	EnvironmentSetupResult(result *EnvironmentSetupResult)
	CommandOutput(info *CommandInfo) (io.WriteCloser, error)
	CommandResult(result *CommandResult)
	Finalize() error

Reporter is used by RunBatch to report on batch execution.

type RunBatchOptions

type RunBatchOptions struct {
	Parallelism          int
	MaxStacksPerPipeline int
	Bail                 bool
	Advisory             bool
	Reporter             Reporter
	Events               chan<- interface{}

RunBatchOptions are the options for RunBatch.


Path Synopsis

Jump to

Keyboard shortcuts

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