Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MkdirTempAbs ¶
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