builder

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2017 License: Apache-2.0 Imports: 21 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExecutor

func NewExecutor(ctx context.Context, name string, log *logger.Logger, showRun, useCache, tty bool) (executor.Executor, error)

NewExecutor returns a valid executor for the given name, or error.

func ResetPulls added in v0.4.2

func ResetPulls()

ResetPulls is a function to facilitate testing of the coordinated pull functionality.

Types

type BuildConfig added in v0.4.1

type BuildConfig struct {
	Cache     bool
	TTY       bool // controls terminal codes
	ShowRun   bool
	OmitFuncs []string
	Context   context.Context
	Runner    chan struct{}
	FileName  string
	Logger    *logger.Logger
}

BuildConfig is a struct containing the configuration for the builder.

type BuildResult added in v0.4.1

type BuildResult struct {
	FileName string
	Value    *mruby.MrbValue
	Err      error
}

BuildResult is an encapsulated tuple of *mruby.MrbValue and error used for communicating... build results.

type Builder

type Builder struct {
	Logger *logger.Logger // public so its output can be tested
	// contains filtered or unexported fields
}

Builder implements the builder core.

func NewBuilder

func NewBuilder(bc BuildConfig) (*Builder, error)

NewBuilder creates a new builder. Returns error on docker or mruby issues.

func (*Builder) AddVerb

func (b *Builder) AddVerb(name string, vd *verbDefinition)

AddVerb adds a function to the mruby dispatch as well as adding hooks around the call to ensure containers are committed and intermediate layers are cleared.

func (*Builder) Close

func (b *Builder) Close() error

Close tears down all functions of the builder, preparing it for exit.

func (*Builder) FileName added in v0.4.1

func (b *Builder) FileName() string

FileName returns the filename that invoked the build.

func (*Builder) ImageID

func (b *Builder) ImageID() string

ImageID returns the latest known Image identifier that we committed. At the end of the run this will be the golden docker image.

func (*Builder) Mrb added in v0.3.3

func (b *Builder) Mrb() *mruby.Mrb

Mrb returns the mrb (mruby) instance the builder is using.

func (*Builder) Result added in v0.4.1

func (b *Builder) Result() BuildResult

Result returns the latest cached result from any run invocation. The behavior is undefined if called before any Run()-style invocation.

func (*Builder) Run

func (b *Builder) Run() BuildResult

Run runs the script set by the BuildConfig. It closes the run channel when it finishes.

func (*Builder) RunCode added in v0.3.3

func (b *Builder) RunCode(val *mruby.MrbValue, stackKeep int) (BuildResult, int)

RunCode runs the ruby value (a proc) and returns the result. It does not close the run channel.

func (*Builder) RunScript added in v0.4.1

func (b *Builder) RunScript(script string) BuildResult

RunScript runs the provided script. It does not close the run channel.

func (*Builder) SetContext added in v0.4.1

func (b *Builder) SetContext(ctx context.Context)

SetContext sets the execution context.

func (*Builder) Tag

func (b *Builder) Tag(name string) error

Tag tags the last image yielded by the builder with the provided name.

func (*Builder) Wait added in v0.4.1

func (b *Builder) Wait() BuildResult

Wait waits for the build to complete.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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