buildcontext

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const EarthIgnoreFile = ".earthignore"

EarthIgnoreFile is the name of the earth ignore file.

Variables

View Source
var (
	// ErrNoGitBinary is an error returned when no git binary is found.
	ErrNoGitBinary = errors.New("No git binary found")
	// ErrNotAGitDir is an error returned when a given directory is not a git dir.
	ErrNotAGitDir = errors.New("Not a git directory")
	// ErrCouldNotDetectRemote is an error returned when git remote could not be detected or parsed.
	ErrCouldNotDetectRemote = errors.New("Could not auto-detect or parse Git remote URL")
)
View Source
var ImplicitExcludes = []string{
	".tmp-earth-out/",
	"build.earth",
	EarthIgnoreFile,
}

ImplicitExcludes is a list of implicit patterns to exclude.

Functions

func TargetWithGitMeta

func TargetWithGitMeta(target domain.Target, gitMeta *GitMetadata) domain.Target

TargetWithGitMeta applies git metadata to the target naming.

Types

type Data

type Data struct {
	// EarthfilePath is the local path where the build.earth file can be found.
	EarthfilePath string
	// BuildContext is the state to use for the build.
	BuildContext llb.State
	// GitMetadata contains git metadata information.
	GitMetadata *GitMetadata
	// Target is the earthly target.
	Target domain.Target
	// LocalDirs is the local dirs map to be passed as part of the buildkit solve.
	LocalDirs map[string]string
}

Data represents a resolved target's build context data.

type GitMetadata

type GitMetadata struct {
	BaseDir    string
	RelDir     string
	RemoteURL  string
	GitVendor  string
	GitProject string
	Hash       string
	Branch     []string
	Tags       []string
}

GitMetadata is a collection of git information about a certain directory.

func Metadata

func Metadata(ctx context.Context, dir string) (*GitMetadata, error)

Metadata performs git metadata detection on the provided directory.

func (*GitMetadata) Clone

func (gm *GitMetadata) Clone() *GitMetadata

Clone returns a copy of the GitMetadata object.

type Resolver

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

Resolver is a build context resolver.

func NewResolver

func NewResolver(bkClient *client.Client, console conslogging.ConsoleLogger, sessionID string) *Resolver

NewResolver returns a new NewResolver.

func (*Resolver) Close

func (r *Resolver) Close() error

Close closes the resolver, freeing up any internal resources.

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, target domain.Target) (*Data, error)

Resolve returns resolved build context data.

Jump to

Keyboard shortcuts

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