artifact

package
v0.0.0-...-703489d Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ResultBuilt is used to cache results of building the artifacts.
	ResultBuilt = "built"

	// ResultPublication is used to cache results of publication of artifacts.
	ResultPublication = "publication"

	// BinariesByPlatform is used to assign built binary to a platform.
	BinariesByPlatform = "binary.by-platform"
)
View Source
const (
	// ArtifactsBuilt is used to list artifacts that was built.
	ArtifactsBuilt = "artifacts.built"
)

Variables

View Source
var (
	// ErrGoBuildFailed when go fails to build the project.
	ErrGoBuildFailed = errors.New("go build failed")

	// ErrInvalidArtifact when invalid type of artifact is given.
	ErrInvalidArtifact = errors.New("invalid artifact")
)
View Source
var ErrKoFailed = errors.New("ko failed")

ErrKoFailed when th Google's ko fails to build.

View Source
var ErrMisconfiguration = errors.New("project configuration is faulty")

ErrMisconfiguration when the project configuration faulty.

Functions

func BuildKey

func BuildKey(artifact config.Artifact) config.ResultKey

BuildKey returns the config.ResultKey for a build command.

func ConfigureDefaults

func ConfigureDefaults()

ConfigureDefaults will configure default builders and publishers to be used.

func ImageReferenceOf

func ImageReferenceOf(img Image) config.Resolver

ImageReferenceOf will try to fetch an image reference from image build result.

func PublishKey

func PublishKey(artifact config.Artifact) config.ResultKey

PublishKey returns the config.ResultKey for a publish command.

Types

type Binary

type Binary struct {
	config.Metadata
	Platforms []Platform
}

Binary represents a binary that will be built.

func (Binary) GetType

func (b Binary) GetType() string

type BinaryBuilder

type BinaryBuilder struct{}

BinaryBuilder is a regular binary Golang builder.

func (BinaryBuilder) Accepts

func (bb BinaryBuilder) Accepts(artifact config.Artifact) bool

func (BinaryBuilder) Build

func (bb BinaryBuilder) Build(artifact config.Artifact, notifier config.Notifier) config.Result

type Image

type Image struct {
	config.Metadata
	Labels        map[string]config.Resolver
	Architectures []platform.Architecture
}

Image is an OCI image that will be built from a binary.

func (Image) GetType

func (i Image) GetType() string

type KoBuilder

type KoBuilder struct{}

KoBuilder builds images with Google's KO.

func (KoBuilder) Accepts

func (kb KoBuilder) Accepts(artifact config.Artifact) bool

func (KoBuilder) Build

func (kb KoBuilder) Build(artifact config.Artifact, notifier config.Notifier) config.Result

type KoPublisher

type KoPublisher struct {
	Configurators []KoPublisherConfigurator
}

KoPublisher publishes images with Google's KO.

func (KoPublisher) Accepts

func (kp KoPublisher) Accepts(artifact config.Artifact) bool

func (KoPublisher) Publish

func (kp KoPublisher) Publish(artifact config.Artifact, notifier config.Notifier) config.Result

type KoPublisherConfigurator

type KoPublisherConfigurator func(*options.PublishOptions) error

KoPublisherConfigurator is used to configure the publish options for KO.

type ListPublisher

type ListPublisher struct {
	FilePath         string
	ResultsRetriever func(config.Artifact) *config.Result
}

ListPublisher will output built artifacts as a "\n" delimited list in a result file.

func (ListPublisher) Accepts

func (l ListPublisher) Accepts(artifact config.Artifact) bool

func (ListPublisher) Publish

func (l ListPublisher) Publish(artifact config.Artifact, notifier config.Notifier) config.Result

type Platform

type Platform struct {
	platform.OS
	platform.Architecture
}

Platform to built binary for.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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