pkglib

package
v0.0.0-...-18f9808 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiskUsage

func DiskUsage(buildersMap map[string]string, builderImage string, platformsToClean []string, verbose bool) error

DiskUsage of builder

func NewPkgInfo

func NewPkgInfo() pkgInfo

func PruneBuilder

func PruneBuilder(buildersMap map[string]string, builderImage string, platformsToClean []string, verbose bool) error

PruneBuilder clean build cache of builder

Types

type BuildOpt

type BuildOpt func(bo *buildOpts) error

BuildOpt allows callers to specify options to Build

func WithBuildBuilderImage

func WithBuildBuilderImage(image string) BuildOpt

WithBuildBuilderImage set the builder container image to use.

func WithBuildBuilderRestart

func WithBuildBuilderRestart(restart bool) BuildOpt

WithBuildBuilderRestart restart the builder container even if it already is running with the correct image version

func WithBuildBuilders

func WithBuildBuilders(builders map[string]string) BuildOpt

WithBuildBuilders which builders, as named contexts per platform, to use

func WithBuildCacheDir

func WithBuildCacheDir(dir string) BuildOpt

WithBuildCacheDir provide a build cache directory to use

func WithBuildCacheProvider

func WithBuildCacheProvider(c lktspec.CacheProvider) BuildOpt

WithBuildCacheProvider provides a cacheProvider to use. If nil, defaults to the one shipped with linuxkit

func WithBuildDocker

func WithBuildDocker(runner dockerRunner) BuildOpt

WithBuildDocker provides a docker runner to use. If nil, defaults to the current platform

func WithBuildForce

func WithBuildForce() BuildOpt

WithBuildForce forces a build even if an image already exists

func WithBuildIgnoreCache

func WithBuildIgnoreCache() BuildOpt

WithBuildIgnoreCache when building an image, do not look in local cache for dependent images

func WithBuildManifest

func WithBuildManifest() BuildOpt

WithBuildManifest creates a multi-arch manifest for the image

func WithBuildOutputWriter

func WithBuildOutputWriter(w io.Writer) BuildOpt

WithBuildOutputWriter set the output writer for messages. If nil, defaults to stdout

func WithBuildPlatforms

func WithBuildPlatforms(platforms ...imagespec.Platform) BuildOpt

WithBuildPlatforms which platforms to build for

func WithBuildPull

func WithBuildPull() BuildOpt

WithBuildPull pull down the image to cache if it already exists in registry

func WithBuildPush

func WithBuildPush() BuildOpt

WithBuildPush pushes the result of the build to the registry

func WithBuildSkip

func WithBuildSkip() BuildOpt

WithBuildSkip skips the actual build and only pushes/releases (if configured)

func WithBuildTargetDockerCache

func WithBuildTargetDockerCache() BuildOpt

WithBuildTargetDockerCache put the build target in the docker cache instead of the default linuxkit cache

func WithRelease

func WithRelease(r string) BuildOpt

WithRelease releases as the given version after push

type Pkg

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

Pkg encapsulates information about a package's source

func NewFromConfig

func NewFromConfig(cfg PkglibConfig, args ...string) ([]Pkg, error)

NewFromConfig creates a range of Pkg from a PkglibConfig and paths to packages.

func (Pkg) Arches

func (p Pkg) Arches() []string

Arches which arches this can be built for

func (Pkg) Build

func (p Pkg) Build(bos ...BuildOpt) error

Build builds the package

func (Pkg) FullTag

func (p Pkg) FullTag() string

FullTag returns a reference expanded tag

func (Pkg) Hash

func (p Pkg) Hash() string

Hash returns the hash of the package

func (Pkg) Index

func (p Pkg) Index(bos ...BuildOpt) error

Index create an index for the package tag based on all arch-specific tags in the registry.

func (Pkg) ReleaseTag

func (p Pkg) ReleaseTag(release string) (string, error)

ReleaseTag returns the tag to use for a particular release of the package

func (Pkg) Tag

func (p Pkg) Tag() string

Tag returns the tag to use for the package

func (Pkg) TrustEnabled

func (p Pkg) TrustEnabled() bool

TrustEnabled returns true if trust is enabled

type PkglibConfig

type PkglibConfig struct {
	DisableCache *bool
	Network      *bool
	Org          *string
	BuildYML     string
	Hash         string
	HashCommit   string
	HashPath     string
	Dirty        bool
	Dev          bool
}

PkglibConfig contains the configuration for the pkglib package. It is used to override the default behaviour of the package. Fields that are pointers are so that the caller can leave it as nil for "use whatever default pkglib has", while non-nil means "explicitly override".

Jump to

Keyboard shortcuts

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