build

package
v0.0.97 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FixedPoint = time.Unix(1, 1)
)

Functions

func CopyConfiguration

func CopyConfiguration(b Configuration) *buildConfiguration

func IsPrebuilt

func IsPrebuilt(spec Spec) (oci.ImageID, bool)

func NewBuildTarget

func NewBuildTarget(target *specs.Platform) *buildTarget

func PlatformsOrOverrides

func PlatformsOrOverrides(platforms []specs.Platform) []specs.Platform

func Prebuilt

func Prebuilt(imgid oci.ImageID) compute.Computable[oci.ImageID]

func PrebuiltResolveOpts

func PrebuiltResolveOpts() oci.ResolveOpts

Types

type BuildPlatformsVar

type BuildPlatformsVar struct{}

func (BuildPlatformsVar) Set

func (BuildPlatformsVar) String

func (BuildPlatformsVar) String() string

func (BuildPlatformsVar) Type

func (BuildPlatformsVar) Type() string

type BuildTarget

type BuildTarget interface {
	SourcePackage() schema.PackageName
	SourceLabel() string

	TargetPlatform() *specs.Platform
	// See Plan.PublishName.
	PublishName() compute.Computable[oci.AllocatedRepository]
}

type Configuration

type Configuration interface {
	BuildTarget

	// If the builder has the ability to produce with buildkit, that's
	// preferred. A reason to do this is for instance when we want to merge
	// multiple images together, and want to defer the merge to buildkit.
	PrefersBuildkit() bool
	Workspace() Workspace
}

type Plan

type Plan struct {
	SourcePackage schema.PackageName
	SourceLabel   string
	BuildKind     storage.Build_Kind
	Spec          Spec
	Workspace     Workspace
	Platforms     []specs.Platform

	// The caller has given us a hint or where the built image will be uploaded
	// to, in case the builder implementation can use this information for
	// optimization purposes. This may be null, and an implementation can always
	// elect to ignore it.
	PublishName compute.Computable[oci.AllocatedRepository]
}

func (Plan) GetSourceLabel added in v0.0.89

func (p Plan) GetSourceLabel() string

func (Plan) GetSourcePackageRef added in v0.0.89

func (p Plan) GetSourcePackageRef() *schema.PackageRef

type Spec

type Spec interface {
	BuildImage(context.Context, pkggraph.SealedContext, Configuration) (compute.Computable[oci.Image], error)
	PlatformIndependent() bool
}

func PrebuiltPlan

func PrebuiltPlan(imgid oci.ImageID, platformIndependent bool, opts oci.ResolveOpts) Spec

type Workspace

type Workspace interface {
	ModuleName() string
	Abs() string
	VersionedFS(rel string, observeChanges bool) compute.Computable[wscontents.Versioned]
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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