builder

package
v0.0.0-...-8dbc9cc Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Build

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

Build transform BuildConfigurations into Docker images

func NewBuild

func NewBuild(e engine.BuildEngine, exec executor.Executor, buildDef Definition, buildConf config.BuildConfiguration, opts BuildOptions, targetImage string, localContext string) *Build

NewBuild returns a new instance of Build

func (*Build) BuildStages

func (b *Build) BuildStages(stageNames []string) ([]BuildStage, error)

BuildStages builds a set of stages

func (*Build) PrepareStages

func (b *Build) PrepareStages(stageNames []string) ([]BuildStage, error)

PrepareStages builds a set of stages

type BuildOptions

type BuildOptions struct {
	// Check for already build images
	CacheImagePull bool

	// Push built stages for reuse
	CacheImagePush bool

	// DryRun disables any actual image build
	DryRun bool

	// BuildConcurrency indicates how many concurrent image build are allowed
	BuildConcurrency int64

	// PullConcurrency indicates how many concurrent image pull are allowed
	PullConcurrency int64
}

BuildOptions holds the options for a build

type BuildStage

type BuildStage interface {
	Build(engineBuild engine.BuildEngine) error
	ComputeContentHash() error
	ContentHash() string
	Dockerfile() string
	ContextFiles() ([]string, error)
	GetRequiredStages() []string
	GetTagAliases() []string
	ImageTag() (string, error)
	ImageURL() string
	Name() string
	Render() error
	SetImageURL(source string)
	SetSourceImageURL(source string)
	SetStatus(status StageImageStatus)
	SourceImageURL() string
	Status() StageImageStatus
}

BuildStage represents a individual stage which can be built

func NewBuildStage

func NewBuildStage(name string, dockerfile template.Dockerfile, extraIncludePatterns []string) BuildStage

NewBuildStage returns a individual stage

type Definition

type Definition interface {
	CheckValidity() error
	GetStages() ([]string, error)
	GetStageDirectory(stage string) string
	GetStageDockerfile(stageName string) string
}

Definition is the interface to a builder definition, allowing to find stages or Dockerfiles to build

func NewDefinitionFromLocation

func NewDefinitionFromLocation(name, location string) (Definition, error)

NewDefinitionFromLocation returns a builder definition from a local or remote location

func NewDefinitionFromPath

func NewDefinitionFromPath(name, localPath string) Definition

NewDefinitionFromPath returns a builder definition from the local path

type StageImageStatus

type StageImageStatus string

StageImageStatus represents the status of the image corresponding to a stage (e.g. absent, cached, pulled)

const (
	// Initialized is unknown
	Initialized StageImageStatus = "initialize"

	// ImageAbsent is for images not present locally not remotely
	ImageAbsent StageImageStatus = "absent"

	// ImageCached is for images that are found in the Application or Builder's cache
	ImageCached StageImageStatus = "present-in-cache"

	// ImagePulled is for images that were absent but could be pulled
	ImagePulled StageImageStatus = "pulled"

	// ImageBuilt is for images that have been built
	ImageBuilt StageImageStatus = "built"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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