build

package
v0.5.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StdoutLine int = iota
	StderrLine
	ExitCodeLine
	MetadataLine
	ProgressLine
)

Variables

View Source
var (
	// ErrSkip is used as a return value when container execution should be
	// skipped at runtime. It is not returned as an error by any function.
	ErrSkip = errors.New("Skip")

	// ErrTerm is used as a return value when the runner should terminate
	// execution and exit. It is not returned as an error by any function.
	ErrTerm = errors.New("Terminate")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Engine Engine

	// Buffer defines the size of the buffer for the channel to which the
	// console output is streamed.
	Buffer uint
}

Config defines the configuration for creating the Pipeline.

func (*Config) Pipeline

func (c *Config) Pipeline(spec *yaml.Config) *Pipeline

Pipeline creates a build Pipeline using the specific configuration for the given Yaml specification.

type Engine

type Engine interface {
	ContainerStart(*yaml.Container) (string, error)
	ContainerStop(string) error
	ContainerRemove(string) error
	ContainerWait(string) (*State, error)
	ContainerLogs(string) (io.ReadCloser, error)
}

Engine defines the container runtime engine.

type ExitError

type ExitError struct {
	Name string
	Code int
}

An ExitError reports an unsuccessful exit.

func (*ExitError) Error

func (e *ExitError) Error() string

Error returns the error message in string format.

type Line

type Line struct {
	Proc string `json:"proc,omitempty"`
	Time int64  `json:"time,omitempty"`
	Type int    `json:"type,omitempty"`
	Pos  int    `json:"pos,omityempty"`
	Out  string `json:"out,omitempty"`
}

Line is a line of console output.

func (*Line) String

func (l *Line) String() string

type OomError

type OomError struct {
	Name string
}

An OomError reports the process received an OOMKill from the kernel.

func (*OomError) Error

func (e *OomError) Error() string

Error returns the error message in string format.

type Pipeline

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

Pipeline represents a build pipeline.

func (*Pipeline) Done

func (p *Pipeline) Done() <-chan error

Done returns when the process is done executing.

func (*Pipeline) Err

func (p *Pipeline) Err() error

Err returns the error for the current process.

func (*Pipeline) Exec

func (p *Pipeline) Exec()

Exec executes the current step.

func (*Pipeline) Head

func (p *Pipeline) Head() *yaml.Container

Head returns the head item in the list.

func (*Pipeline) Next

func (p *Pipeline) Next() <-chan error

Next returns the next step in the process.

func (*Pipeline) Pipe

func (p *Pipeline) Pipe() <-chan *Line

Pipe returns the build output pipe.

func (*Pipeline) Setup

func (p *Pipeline) Setup() error

Setup prepares the build pipeline environment.

func (*Pipeline) Skip

func (p *Pipeline) Skip()

Skip skips the current step.

func (*Pipeline) Stop

func (p *Pipeline) Stop()

Stop stops the pipeline.

func (*Pipeline) Tail

func (p *Pipeline) Tail() *yaml.Container

Tail returns the tail item in the list.

func (*Pipeline) Teardown

func (p *Pipeline) Teardown()

Teardown removes the pipeline environment.

type State

type State struct {
	ExitCode  int  // container exit code
	OOMKilled bool // container exited due to oom error
}

State defines the state of the container.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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