build

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 19 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBuildArgsFromArtifacts added in v1.16.0

func CreateBuildArgsFromArtifacts(deps []*latest.ArtifactDependency, r ArtifactResolver, missingIsFatal bool) map[string]*string

CreateBuildArgsFromArtifacts creates docker build args for an artifact from its required artifacts slice. If `missingIsFatal` is false then it is permissive of missing entries in the ArtifactResolver and returns nil for those entries.

func DependenciesForArtifact added in v0.7.0

func DependenciesForArtifact(ctx context.Context, a *latest.Artifact, cfg docker.Config, r ArtifactResolver) ([]string, error)

DependenciesForArtifact returns the dependencies for a given artifact.

func TagWithDigest added in v1.1.0

func TagWithDigest(tag, digest string) string

func TagWithImageID added in v1.1.0

func TagWithImageID(ctx context.Context, tag string, imageID string, localDocker docker.LocalDaemon) (string, error)

Types

type Artifact added in v0.8.0

type Artifact struct {
	ImageName string `json:"imageName"`
	Tag       string `json:"tag"`
}

Artifact is the result corresponding to each successful build.

func InOrder added in v1.7.1

func InOrder(ctx context.Context, out io.Writer, tags tag.ImageTags, artifacts []*latest.Artifact, artifactBuilder ArtifactBuilder, concurrency int, store ArtifactStore) ([]Artifact, error)

InOrder builds a list of artifacts in dependency order.

func MergeWithPreviousBuilds added in v0.27.0

func MergeWithPreviousBuilds(builds, previous []Artifact) []Artifact

MergeWithPreviousBuilds merges previous or prebuilt build artifacts with builds. If an artifact is already present in builds, the same artifact from previous will be replaced at the same position.

type ArtifactBuilder added in v1.7.1

type ArtifactBuilder func(ctx context.Context, out io.Writer, artifact *latest.Artifact, tag string) (string, error)

func WithLogFile added in v1.7.1

func WithLogFile(builder ArtifactBuilder, muted Muted) ArtifactBuilder

WithLogFile wraps an `artifactBuilder` so that it optionally outputs its logs to a file.

type ArtifactGraph added in v1.7.1

type ArtifactGraph map[string]*latest.Artifact

ArtifactGraph is a map of [artifact image : artifact definition]

func ToArtifactGraph added in v1.7.1

func ToArtifactGraph(artifacts []*latest.Artifact) ArtifactGraph

ToArtifactGraph creates an instance of `ArtifactGraph` from `[]*latest.Artifact`

func (ArtifactGraph) Dependencies added in v1.7.1

func (g ArtifactGraph) Dependencies(a *latest.Artifact) []*latest.Artifact

Dependencies returns the de-referenced slice of required artifacts for a given artifact

type ArtifactResolver added in v1.16.0

type ArtifactResolver interface {
	GetImageTag(imageName string) (string, bool)
}

ArtifactResolver provides an interface to resolve built artifact tags by image name.

type ArtifactStore added in v1.7.1

type ArtifactStore interface {
	Record(a *latest.Artifact, tag string)
	GetImageTag(imageName string) (tag string, found bool)
	GetArtifacts(s []*latest.Artifact) ([]Artifact, error)
}

ArtifactStore stores the results of each artifact build.

func NewArtifactStore added in v1.7.1

func NewArtifactStore() ArtifactStore

type Builder

type Builder interface {
	Build(ctx context.Context, out io.Writer, tags tag.ImageTags, artifacts []*latest.Artifact) ([]Artifact, error)

	// Prune removes images built with Skaffold
	Prune(context.Context, io.Writer) error
}

Builder is an interface to the Build API of Skaffold. It must build and make the resulting image accessible to the cluster. This could include pushing to a authorized repository or loading the nodes with the image. If artifacts is supplied, the builder should only rebuild those artifacts.

type ErrSyncMapNotSupported added in v0.32.0

type ErrSyncMapNotSupported struct{}

func (ErrSyncMapNotSupported) Error added in v0.32.0

type Muted added in v1.7.1

type Muted interface {
	MuteBuild() bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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