builder

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirHash

func DirHash(files []string, open func(string) (io.ReadCloser, error)) (string, error)

DirHash computes a hash of the given files contents using Adler-32.

func MkdirTempAbs

func MkdirTempAbs(dir, pattern string) (string, error)

MkdirTempAbs creates a tmp dir and returns the absolute path to the dir. This is required since certain OSes like MacOS create temporary files in e.g. `/private/var`, to which `/var` is a symlink.

Types

type ArtifactBuilder

type ArtifactBuilder struct {
	Storage *gotkstorage.Storage
}

ArtifactBuilder is responsible for building and storing artifacts based on a given specification and source files.

func New

func New(storage *gotkstorage.Storage) *ArtifactBuilder

New creates a new ArtifactBuilder with the given storage backend.

func (*ArtifactBuilder) Build

func (r *ArtifactBuilder) Build(ctx context.Context,
	spec *swapi.OutputArtifact,
	sources map[string]string,
	namespace string,
	workspace string) (*gotkmeta.Artifact, error)

Build creates an artifact from the given specification and sources. It stages the files in a temporary directory within the provided workspace, applies the copy operations, and then archives the staged files into the artifact storage. The resulting artifact metadata is returned. The artifact archive is stored under the following path: <storage-root>/<kind>/<namespace>/<name>/<contents-hash>.tar.gz

Jump to

Keyboard shortcuts

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