buildcontext

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const DockerfileMetaTarget = "@dockerfile"

DockerfileMetaTarget is a target name which signals the resolver that the build file is a dockerfile. The DockerfileMetaTarget is really not a valid Earthly target otherwise.

View Source
const EarthIgnoreFile = ".earthignore"

EarthIgnoreFile is the name of the earthly ignore file.

Variables

View Source
var ErrNoMatch = fmt.Errorf("no git match found")

ErrNoMatch occurs when no git matcher is found

View Source
var ImplicitExcludes = []string{
	".tmp-earthly-out/",
	"build.earth",
	"Earthfile",
	EarthIgnoreFile,
}

ImplicitExcludes is a list of implicit patterns to exclude.

Functions

This section is empty.

Types

type Data

type Data struct {
	// BuildFilePath is the local path where the Earthfile or Dockerfile can be found.
	BuildFilePath string
	// BuildContext is the state to use for the build.
	BuildContext llb.State
	// GitMetadata contains git metadata information.
	GitMetadata *gitutil.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 GitLookup added in v0.4.0

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

GitLookup looksup gits

func NewGitLookup added in v0.4.0

func NewGitLookup() *GitLookup

NewGitLookup creates new lookuper

func (*GitLookup) AddMatcher added in v0.4.0

func (gl *GitLookup) AddMatcher(name, pattern, sub, user, password, suffix, protocol, keyScan string) error

AddMatcher adds a new matcher for looking up git repos

func (*GitLookup) DisableSSH added in v0.4.0

func (gl *GitLookup) DisableSSH()

DisableSSH changes all git matchers from ssh to https

func (*GitLookup) GetCloneURL added in v0.4.0

func (gl *GitLookup) GetCloneURL(path string) (string, string, string, error)

GetCloneURL returns the repo to clone, and a path relative to the repo

"github.com/earthly/earthly"             ---> ("git@github.com/earthly/earthly.git", "")
"github.com/earthly/earthly/examples"    ---> ("git@github.com/earthly/earthly.git", "examples")
"github.com/earthly/earthly/examples/go" ---> ("git@github.com/earthly/earthly.git", "examples/go")

Additionally a ssh keyscan might be returned (or an empty string indicating none was configured)

type Resolver

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

Resolver is a build context resolver.

func NewResolver

func NewResolver(sessionID string, cleanCollection *cleanup.Collection, gitLookup *GitLookup) *Resolver

NewResolver returns a new NewResolver.

func (*Resolver) Resolve

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

Resolve returns resolved build context data.

Directories

Path Synopsis
Package provider is heavily based on fsSyncProvider in github.com/moby/buildkit/session/filesync.
Package provider is heavily based on fsSyncProvider in github.com/moby/buildkit/session/filesync.

Jump to

Keyboard shortcuts

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