Documentation
¶
Overview ¶
Package v1alpha2 contains type definitions for `pkg.yaml`.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dependency ¶
type Dependency struct {
Image string `yaml:"image,omitempty"`
Stage string `yaml:"stage,omitempty"`
From string `yaml:"from,omitempty"`
To string `yaml:"to,omitempty"`
Platform string `yaml:"platform,omitempty"`
Runtime bool `yaml:"runtime,omitempty"`
}
Dependency on another image or stage.
func (*Dependency) Dest ¶
func (d *Dependency) Dest() string
Dest returns copy destination (to base).
func (*Dependency) IsInternal ¶
func (d *Dependency) IsInternal() bool
IsInternal checks whether dependency is internal to some stage.
func (*Dependency) Src ¶
func (d *Dependency) Src() string
Src returns copy source (from dependency).
type Environment ¶
Environment is a set of environment variables to be set in the step.
type Instruction ¶
type Instruction string
Instruction is a single shell command.
func (Instruction) Script ¶
func (ins Instruction) Script() string
Script formats Instruction for /bin/sh -c execution.
type NetworkMode ¶ added in v0.4.0
type NetworkMode int
NetworkMode is a specification of the network mode.
const ( // NetworkModeNone disables networking for the step. NetworkModeNone NetworkMode = iota // NetworkModeDefault leaves network in default (container mode). NetworkModeDefault // NetworkModeHost uses host network for the step. NetworkModeHost )
func (NetworkMode) MarshalYAML ¶ added in v0.4.0
func (m NetworkMode) MarshalYAML() (any, error)
MarshalYAML implements yaml.Marshaller interface.
func (NetworkMode) String ¶ added in v0.4.0
func (m NetworkMode) String() string
func (*NetworkMode) UnmarshalYAML ¶ added in v0.4.0
func (m *NetworkMode) UnmarshalYAML(unmarshal func(any) error) error
UnmarshalYAML implements yaml.Unmarshaller interface.
type Pkg ¶
type Pkg struct {
TemplatedFiles []TemplatedFile `yaml:"-"`
Context types.Variables `yaml:"-"`
Name string `yaml:"name,omitempty"`
Shell Shell `yaml:"shell,omitempty"`
BaseDir string `yaml:"-"`
FileName string `yaml:"-"`
Install Install `yaml:"install,omitempty"`
Dependencies Dependencies `yaml:"dependencies,omitempty"`
Steps Steps `yaml:"steps,omitempty"`
Finalize []Finalize `yaml:"finalize,omitempty"`
Variant Variant `yaml:"variant,omitempty"`
}
Pkg represents build instructions for a single package.
func (*Pkg) AttachTemplatedFile ¶ added in v0.5.2
AttachTemplatedFile attaches a templated file to the package context.
func (*Pkg) GetTemplatedFiles ¶ added in v0.5.2
func (p *Pkg) GetTemplatedFiles() []TemplatedFile
GetTemplatedFiles return a list of templated files in the package.
type Pkgfile ¶
type Pkgfile struct {
Vars types.Variables `yaml:"vars,omitempty"`
Labels map[string]string `yaml:"labels,omitempty"`
Format string `yaml:"format"`
}
Pkgfile describes structure of 'Pkgfile'.
func NewPkgfile ¶
NewPkgfile loads Pkgfile from `[]byte` contents.
type SBOMStep ¶ added in v0.5.0
type SBOMStep struct {
OutputPath string `yaml:"outputPath,omitempty"`
Name string `yaml:"name,omitempty"`
Version string `yaml:"version,omitempty"`
CPEs []string `yaml:"cpes,omitempty"`
PURL string `yaml:"purl,omitempty"`
Licenses []string `yaml:"licenses,omitempty"`
}
SBOMStep is a step with data to generate an SBOM (Software Bill of Materials) for the package.
type Source ¶
type Source struct {
URL string `yaml:"url,omitempty"`
Destination string `yaml:"destination,omitempty"`
SHA256 string `yaml:"sha256,omitempty"`
SHA512 string `yaml:"sha512,omitempty"`
}
Source describe build source to be downloaded.
func (*Source) ToSHA512Sum ¶
ToSHA512Sum returns in format of line expected by 'sha512sum'.
type Step ¶
type Step struct {
Env Environment `yaml:"env,omitempty"`
CachePaths []string `yaml:"cachePaths,omitempty"`
TmpDir string `yaml:"-"`
Sources Sources `yaml:"sources,omitempty"`
Prepare Instructions `yaml:"prepare,omitempty"`
Build Instructions `yaml:"build,omitempty"`
Install Instructions `yaml:"install,omitempty"`
Test Instructions `yaml:"test,omitempty"`
SBOM SBOMStep `yaml:"sbom,omitempty"`
Network NetworkMode `yaml:"network,omitempty"`
}
Step describes a single build step.
Steps are executed sequentially, each step runs in its own empty temporary directory.
type TemplatedFile ¶ added in v0.5.2
TemplatedFile is a file attached to the package context which went through the templating process.
type Variant ¶
type Variant int
Variant is a kind of base build image.
func (Variant) MarshalYAML ¶
MarshalYAML implements yaml.Marshaller interface.