Documentation ¶
Index ¶
Constants ¶
const DockerfileMetaTarget = "@dockerfile:"
DockerfileMetaTarget is a target name prefix which signals the resolver that the build file is a dockerfile. The DockerfileMetaTarget is really not a valid Earthly target otherwise.
Variables ¶
var ErrNoMatch = errors.Errorf("no git match found")
ErrNoMatch occurs when no git matcher is found
var ImplicitExcludes = []string{
".tmp-earthly-out/",
"build.earth",
"Earthfile",
earthIgnoreFile,
earthlyIgnoreFile,
}
ImplicitExcludes is a list of implicit patterns to exclude.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct { // The parsed Earthfile AST. Earthfile spec.Earthfile // BuildFilePath is the local path where the Earthfile or Dockerfile can be found. BuildFilePath string // BuildContext is the state to use for the build. BuildContextFactory llbfactory.Factory // GitMetadata contains git metadata information. GitMetadata *gitutil.GitMetadata // Target is the earthly reference. Ref domain.Reference // LocalDirs is the local dirs map to be passed as part of the buildkit solve. LocalDirs map[string]string // Features holds the feature state for the build context Features *features.Features }
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(console conslogging.ConsoleLogger, sshAuthSock string) *GitLookup
NewGitLookup creates new lookuper
func (*GitLookup) AddMatcher ¶ added in v0.4.0
func (gl *GitLookup) AddMatcher(name, pattern, sub, user, password, prefix, suffix, protocol, knownHosts string, strictHostKeyChecking bool, port int) error
AddMatcher adds a new matcher for looking up git repos
func (*GitLookup) ConvertCloneURL ¶ added in v0.6.15
ConvertCloneURL takes a url such as https://github.com/user/repo.git or git@github.com:user/repo.git and makes use of configured git credentials and protocol preferences to convert it into the appropriate https or ssh protocol. it also returns a keyScan
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
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, console conslogging.ConsoleLogger, featureFlagOverrides string) *Resolver
NewResolver returns a new NewResolver.
func (*Resolver) Resolve ¶
func (r *Resolver) Resolve(ctx context.Context, gwClient gwclient.Client, platr *platutil.Resolver, ref domain.Reference) (*Data, error)
Resolve returns resolved context data for a given Earthly reference. If the reference is a target, then the context will include a build context and possibly additional local directories.