builder

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2016 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCmdTimeout = 600 * time.Second

Functions

This section is empty.

Types

type BaseStage

type BaseStage struct {
	Before   StepList `json:"before"`
	Override StepList `json:"override"`
	After    StepList `json:"after"`
}

type BuildSpec

type BuildSpec struct {
	Environment  EnvironmentStage  `json:"environment"`
	Dependencies DependenciesStage `json:"dependencies"`
	Test         TestStage         `json:"test"`
	Package      PackageStage      `json:"package"`
}

func ParseBuildSpec

func ParseBuildSpec(src io.Reader) (*BuildSpec, error)

func ParseBuildSpecFile

func ParseBuildSpecFile(file string) (*BuildSpec, error)

type Builder

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

func NewBuilder

func NewBuilder(workdir string, build *BuildSpec, profile *ProfileSpec) (*Builder, error)

func (*Builder) ExecInEnvironment

func (b *Builder) ExecInEnvironment(cmd string) error

func (*Builder) ExecuteDependenciesStage

func (b *Builder) ExecuteDependenciesStage(useCache bool, cacheImage string) (string, error)

func (*Builder) ExecuteEnivronmentStage

func (b *Builder) ExecuteEnivronmentStage(useCache bool, cacheImage string) (string, error)

func (*Builder) ExecuteTestStage

func (b *Builder) ExecuteTestStage() error

type ConsolUI

type ConsolUI struct {
}

func (*ConsolUI) Print

func (ui *ConsolUI) Print(s string)

func (*ConsolUI) Printf

func (ui *ConsolUI) Printf(s string, args ...interface{})

func (*ConsolUI) Write

func (ui *ConsolUI) Write(p []byte) (n int, err error)

type DependenciesStage

type DependenciesStage struct {
	BaseStage
}

type EnvironmentStage

type EnvironmentStage struct {
	Profile   string   `json:"profile"`
	Workspace string   `json:"workspace"`
	Mounts    []string `json:"mounts"`
	BaseStage
}

type LocalProfileResolver

type LocalProfileResolver struct {
	Path string
}

func (*LocalProfileResolver) ResolveProfile

func (res *LocalProfileResolver) ResolveProfile() (*ProfileSpec, error)

type PackageStage

type PackageStage struct {
	PackageStageDocker `json:"docker"`
}

type PackageStageDocker

type PackageStageDocker struct {
	Tag        string `json:"tag"`
	Dockerfile string `json:"dockerfile"`
}

type ProfileResolver

type ProfileResolver interface {
	ResolveProfile() (*ProfileSpec, error)
}

func NewProfileResolver

func NewProfileResolver(profile string) (ProfileResolver, error)

type ProfileSpec

type ProfileSpec struct {
	Shell            string   `json:"shell"`
	Image            string   `json:"image"`
	Workspace        string   `json:"workspace"`
	CacheDirectories []string `json:"cache_directories"`
	Dependencies     []Step   `json:"dependencies"`
	Test             []Step   `json:"test"`
}

func ParseProfileSpec

func ParseProfileSpec(src io.Reader) (*ProfileSpec, error)

func ParseProfileSpecFile

func ParseProfileSpecFile(file string) (*ProfileSpec, error)

func (*ProfileSpec) MakeCmd

func (profile *ProfileSpec) MakeCmd(cmd string) strslice.StrSlice

type Step

type Step struct {
	Cmd     string   `json:"cmd"`
	Timeout int      `json:"timeout"`
	Cache   bool     `json:"cache"`
	Env     []string `json:"environment"`
	Pwd     string   `json:"pwd"`
}

func (*Step) UnmarshalJSON

func (step *Step) UnmarshalJSON(data []byte) error

type StepList

type StepList struct {
	Steps []Step
}

func (*StepList) UnmarshalJSON

func (sl *StepList) UnmarshalJSON(data []byte) error

type TestStage

type TestStage struct {
	BaseStage
}

type UI

type UI interface {
	Write(p []byte) (n int, err error)
	Print(string)
	Printf(string, ...interface{})
}

Jump to

Keyboard shortcuts

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