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 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") // ErrCouldNotDetectGitHash is an error returned when git hash could not be detected. ErrCouldNotDetectGitHash = errors.New("Could not auto-detect or parse Git hash") // ErrCouldNotDetectGitBranch is an error returned when git branch could not be detected. ErrCouldNotDetectGitBranch = errors.New("Could not auto-detect or parse Git branch") )
View Source
var ImplicitExcludes = []string{ ".tmp-earth-out/", "build.earth", "Earthfile", 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 { // 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 *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(sessionID string, cleanCollection *cleanup.Collection) *Resolver
NewResolver returns a new NewResolver.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.