Documentation
¶
Index ¶
- Constants
- func EncodeCapability(effectiveBits, permittedBits, inheritableBits uint32) []byte
- func ParseCapabilities(caps []Capability) (map[string]capabilityData, error)
- func SHA256(text string) string
- type BuildOption
- type CPE
- type Capabilities
- type Capability
- type Checks
- type Configuration
- type ConfigurationParsingOption
- func WithCommit(hash string) ConfigurationParsingOption
- func WithDefaultCPU(cpu string) ConfigurationParsingOption
- func WithDefaultCPUModel(cpumodel string) ConfigurationParsingOption
- func WithDefaultDisk(disk string) ConfigurationParsingOption
- func WithDefaultMemory(memory string) ConfigurationParsingOption
- func WithDefaultTimeout(timeout time.Duration) ConfigurationParsingOption
- func WithEnvFileForParsing(path string) ConfigurationParsingOption
- func WithFS(filesystem fs.FS) ConfigurationParsingOption
- func WithVarsFileForParsing(path string) ConfigurationParsingOption
- type ContentsOption
- type Copyright
- type DataItems
- type Dependencies
- type EnvironmentOption
- type ErrInvalidConfiguration
- type GitHubMonitor
- type GitMonitor
- type Input
- type ListOption
- type Needs
- type Package
- func (p Package) CPEString() (string, error)
- func (p Package) FullCopyright() string
- func (p Package) FullVersion() string
- func (p Package) LicenseExpression() string
- func (p Package) LicensingInfos(ctx context.Context, workspaceDir string) (map[string]string, error)
- func (p Package) PackageURL(distro, arch string) *purl.PackageURL
- func (p Package) PackageURLForSubpackage(distro, arch, subpackage string) *purl.PackageURL
- type PackageOption
- type Period
- type Pipeline
- type PipelineAssertions
- type RangeData
- type ReleaseMonitor
- type Resources
- type Schedule
- type Scriptlets
- type Subpackage
- type Test
- type Trigger
- type Update
- type VarTransforms
- type VersionHandler
- type VersionTransform
Constants ¶
const ( SubstitutionPackageName = "${{package.name}}" SubstitutionPackageVersion = "${{package.version}}" SubstitutionPackageFullVersion = "${{package.full-version}}" SubstitutionPackageEpoch = "${{package.epoch}}" SubstitutionPackageDescription = "${{package.description}}" SubstitutionPackageSrcdir = "${{package.srcdir}}" SubstitutionTargetsOutdir = "${{targets.outdir}}" SubstitutionTargetsDestdir = "${{targets.destdir}}" SubstitutionTargetsContextdir = "${{targets.contextdir}}" SubstitutionSubPkgName = "${{subpkg.name}}" SubstitutionSubPkgDir = "${{targets.subpkgdir}}" SubstitutionContextName = "${{context.name}}" SubstitutionHostTripletGnu = "${{host.triplet.gnu}}" SubstitutionHostTripletRust = "${{host.triplet.rust}}" SubstitutionCrossTripletGnuGlibc = "${{cross.triplet.gnu.glibc}}" SubstitutionCrossTripletGnuMusl = "${{cross.triplet.gnu.musl}}" SubstitutionCrossTripletRustGlibc = "${{cross.triplet.rust.glibc}}" SubstitutionCrossTripletRustMusl = "${{cross.triplet.rust.musl}}" SubstitutionBuildArch = "${{build.arch}}" SubstitutionBuildGoArch = "${{build.goarch}}" )
Variables ¶
This section is empty.
Functions ¶
func EncodeCapability ¶ added in v0.23.9
EncodeCapability returns the byte slice necessary to set the final capability xattr.
func ParseCapabilities ¶ added in v0.23.9
func ParseCapabilities(caps []Capability) (map[string]capabilityData, error)
ParseCapabilities processes all capabilities for a given path.
Types ¶
type BuildOption ¶
type BuildOption struct {
Vars map[string]string `yaml:"vars,omitempty"`
Environment EnvironmentOption `yaml:"environment,omitempty"`
}
BuildOption describes an optional deviation to a package build.
type CPE ¶ added in v0.21.2
type CPE struct {
Part string `json:"part,omitempty" yaml:"part,omitempty"`
Vendor string `json:"vendor,omitempty" yaml:"vendor,omitempty"`
Product string `json:"product,omitempty" yaml:"product,omitempty"`
Edition string `json:"edition,omitempty" yaml:"edition,omitempty"`
Language string `json:"language,omitempty" yaml:"language,omitempty"`
SWEdition string `json:"sw_edition,omitempty" yaml:"sw_edition,omitempty"`
TargetSW string `json:"target_sw,omitempty" yaml:"target_sw,omitempty"`
TargetHW string `json:"target_hw,omitempty" yaml:"target_hw,omitempty"`
Other string `json:"other,omitempty" yaml:"other,omitempty"`
}
CPE stores values used to produce a CPE to describe the package, suitable for matching against NVD records.
Based on the spec found at https://nvlpubs.nist.gov/nistpubs/Legacy/IR/nistir7695.pdf.
For Melange, the "part" attribute should always be interpreted as "a" (for "application") unless otherwise specified.
The "Version" and "Update" fields have been intentionally left out of the CPE struct to avoid confusion with the version information of the package itself.
type Capabilities ¶ added in v0.19.0
type Capabilities struct {
// Linux process capabilities to add to the pipeline container.
Add []string `json:"add,omitempty" yaml:"add,omitempty"`
// Linux process capabilities to drop from the pipeline container.
Drop []string `json:"drop,omitempty" yaml:"drop,omitempty"`
}
Capabilities is the configuration for Linux capabilities for the runner.
type Capability ¶ added in v0.23.9
type Capability struct {
Path string `json:"path,omitempty" yaml:"path,omitempty"`
Add map[string]string `json:"add,omitempty" yaml:"add,omitempty"`
Reason string `json:"reason,omitempty" yaml:"reason,omitempty"`
}
Capability stores paths and an associated map of capabilities and justification to include in a package. These capabilities will be set after pipelines run to avoid permissions issues with `setcap`. Empty justifications will result in an error.
type Checks ¶
type Checks struct {
// Optional: disable these linters that are not enabled by default.
Disabled []string `json:"disabled,omitempty" yaml:"disabled,omitempty"`
}
type Configuration ¶
type Configuration struct {
// Package metadata
Package Package `json:"package" yaml:"package"`
// The specification for the packages build environment
// Optional: environment variables to override apko
Environment apko_types.ImageConfiguration `json:"environment" yaml:"environment,omitempty"`
// Optional: Linux capabilities configuration to apply to the melange runner.
Capabilities Capabilities `json:"capabilities" yaml:"capabilities,omitempty"`
// Required: The list of pipelines that produce the package.
Pipeline []Pipeline `json:"pipeline,omitempty" yaml:"pipeline,omitempty"`
// Optional: The list of subpackages that this package also produces.
Subpackages []Subpackage `json:"subpackages,omitempty" yaml:"subpackages,omitempty"`
// Optional: An arbitrary list of data that can be used via templating in the
// pipeline
Data []RangeData `json:"data,omitempty" yaml:"data,omitempty"`
// Optional: The update block determining how this package is auto updated
Update Update `json:"update" yaml:"update,omitempty"`
// Optional: A map of arbitrary variables that can be used via templating in
// the pipeline
Vars map[string]string `json:"vars,omitempty" yaml:"vars,omitempty"`
// Optional: A list of transformations to create for the builtin template
// variables
VarTransforms []VarTransforms `json:"var-transforms,omitempty" yaml:"var-transforms,omitempty"`
// Optional: Deviations to the build
Options map[string]BuildOption `json:"options,omitempty" yaml:"options,omitempty"`
// Test section for the main package.
Test *Test `json:"test,omitempty" yaml:"test,omitempty"`
// contains filtered or unexported fields
}
Configuration is the root melange configuration.
func ParseConfiguration ¶
func ParseConfiguration(ctx context.Context, configurationFilePath string, opts ...ConfigurationParsingOption) (*Configuration, error)
ParseConfiguration returns a decoded build Configuration using the parsing options provided.
func (Configuration) AllPackageNames ¶ added in v0.14.0
func (cfg Configuration) AllPackageNames() iter.Seq[string]
AllPackageNames returns a sequence of all package names in the configuration, i.e. the origin package name and the names of all subpackages.
func (Configuration) GetVarsFromConfig ¶
func (cfg Configuration) GetVarsFromConfig() (map[string]string, error)
Get variables from configuration and return them in a map
func (Configuration) Name ¶
func (cfg Configuration) Name() string
Name returns a name for the configuration, using the package name. This implements the configs.Configuration interface in wolfictl and is important to keep as long as that package is in use.
func (Configuration) PerformVarSubstitutions ¶
func (cfg Configuration) PerformVarSubstitutions(nw map[string]string) error
Perform variable substitutions from the configuration on a given map
func (Configuration) Root ¶
func (cfg Configuration) Root() *yaml.Node
type ConfigurationParsingOption ¶
type ConfigurationParsingOption func(*configOptions)
func WithCommit ¶ added in v0.14.0
func WithCommit(hash string) ConfigurationParsingOption
func WithDefaultCPU ¶ added in v0.5.4
func WithDefaultCPU(cpu string) ConfigurationParsingOption
func WithDefaultCPUModel ¶ added in v0.15.0
func WithDefaultCPUModel(cpumodel string) ConfigurationParsingOption
func WithDefaultDisk ¶ added in v0.11.3
func WithDefaultDisk(disk string) ConfigurationParsingOption
func WithDefaultMemory ¶ added in v0.5.4
func WithDefaultMemory(memory string) ConfigurationParsingOption
func WithDefaultTimeout ¶ added in v0.5.4
func WithDefaultTimeout(timeout time.Duration) ConfigurationParsingOption
func WithEnvFileForParsing ¶
func WithEnvFileForParsing(path string) ConfigurationParsingOption
WithEnvFileForParsing set the paths from which to read an environment file.
func WithFS ¶
func WithFS(filesystem fs.FS) ConfigurationParsingOption
WithFS sets the fs.FS implementation to use. So far this FS is used only for reading the configuration file. If not provided, the default FS will be an os.DirFS created from the configuration file's containing directory.
func WithVarsFileForParsing ¶
func WithVarsFileForParsing(path string) ConfigurationParsingOption
WithVarsFileForParsing sets the path to the vars file to use if the user wishes to populate the variables block from an external file.
type ContentsOption ¶
type ContentsOption struct {
Packages ListOption `yaml:"packages,omitempty"`
}
ContentsOption describes an optional deviation to an apko environment's contents block.
type Copyright ¶
type Copyright struct {
// Optional: The license paths, typically '*'
Paths []string `json:"paths,omitempty" yaml:"paths,omitempty"`
// Optional: Attestations of the license
Attestation string `json:"attestation,omitempty" yaml:"attestation,omitempty"`
// Required: The license for this package
License string `json:"license" yaml:"license"`
// Optional: Path to text of the custom License Ref
LicensePath string `json:"license-path,omitempty" yaml:"license-path,omitempty"`
// Optional: License override
DetectionOverride string `json:"detection-override,omitempty" yaml:"detection-override,omitempty"`
}
type Dependencies ¶
type Dependencies struct {
// Optional: List of runtime dependencies
Runtime []string `json:"runtime,omitempty" yaml:"runtime,omitempty"`
// Optional: List of packages provided
Provides []string `json:"provides,omitempty" yaml:"provides,omitempty"`
// Optional: List of replace objectives
Replaces []string `json:"replaces,omitempty" yaml:"replaces,omitempty"`
// Optional: An integer string compared against other equal package provides used to
// determine priority of provides
ProviderPriority string `json:"provider-priority,omitempty" yaml:"provider-priority,omitempty"`
// Optional: An integer string compared against other equal package provides used to
// determine priority of file replacements
ReplacesPriority string `json:"replaces-priority,omitempty" yaml:"replaces-priority,omitempty"`
// List of self-provided dependencies found outside of lib directories
// ("lib", "usr/lib", "lib64", or "usr/lib64").
Vendored []string `json:"-" yaml:"-"`
}
func (*Dependencies) Summarize ¶
func (dep *Dependencies) Summarize(ctx context.Context)
Summarize lists the dependencies that are configured in a dependency set.
type EnvironmentOption ¶
type EnvironmentOption struct {
Contents ContentsOption `yaml:"contents,omitempty"`
}
EnvironmentOption describes an optional deviation to an apko environment.
type ErrInvalidConfiguration ¶
type ErrInvalidConfiguration struct {
Problem error
}
func (ErrInvalidConfiguration) Error ¶
func (e ErrInvalidConfiguration) Error() string
func (ErrInvalidConfiguration) Unwrap ¶ added in v0.5.2
func (e ErrInvalidConfiguration) Unwrap() error
type GitHubMonitor ¶
type GitHubMonitor struct {
// Org/repo for GitHub
Identifier string `json:"identifier" yaml:"identifier"`
// If the version in GitHub contains a prefix which should be ignored
StripPrefix string `json:"strip-prefix,omitempty" yaml:"strip-prefix,omitempty"`
// If the version in GitHub contains a suffix which should be ignored
StripSuffix string `json:"strip-suffix,omitempty" yaml:"strip-suffix,omitempty"`
// Filter to apply when searching tags on a GitHub repository
//
// Deprecated: Use TagFilterPrefix instead
TagFilter string `json:"tag-filter,omitempty" yaml:"tag-filter,omitempty"`
// Prefix filter to apply when searching tags on a GitHub repository
TagFilterPrefix string `json:"tag-filter-prefix,omitempty" yaml:"tag-filter-prefix,omitempty"`
// Filter to apply when searching tags on a GitHub repository
TagFilterContains string `json:"tag-filter-contains,omitempty" yaml:"tag-filter-contains,omitempty"`
// Override the default of using a GitHub release to identify related tag to
// fetch. Not all projects use GitHub releases but just use tags
UseTags bool `json:"use-tag,omitempty" yaml:"use-tag,omitempty"`
}
GitHubMonitor indicates using the GitHub API
func (*GitHubMonitor) GetFilterContains ¶ added in v0.13.6
func (ghm *GitHubMonitor) GetFilterContains() string
GetFilterContains returns the substring filter to apply when searching tags in GitHubMonitor.
func (*GitHubMonitor) GetFilterPrefix ¶ added in v0.13.6
func (ghm *GitHubMonitor) GetFilterPrefix() string
GetFilterPrefix returns the prefix filter to apply when searching tags in GitHubMonitor.
func (*GitHubMonitor) GetStripPrefix ¶ added in v0.11.3
func (ghm *GitHubMonitor) GetStripPrefix() string
GetStripPrefix returns the prefix that should be stripped from the GitHubMonitor version.
func (*GitHubMonitor) GetStripSuffix ¶ added in v0.11.3
func (ghm *GitHubMonitor) GetStripSuffix() string
GetStripSuffix returns the suffix that should be stripped from the GitHubMonitor version.
type GitMonitor ¶ added in v0.11.3
type GitMonitor struct {
// StripPrefix is the prefix to strip from the version
StripPrefix string `json:"strip-prefix,omitempty" yaml:"strip-prefix,omitempty"`
// If the version in GitHub contains a suffix which should be ignored
StripSuffix string `json:"strip-suffix,omitempty" yaml:"strip-suffix,omitempty"`
// Prefix filter to apply when searching tags on a GitHub repository
TagFilterPrefix string `json:"tag-filter-prefix,omitempty" yaml:"tag-filter-prefix,omitempty"`
// Filter to apply when searching tags on a GitHub repository
TagFilterContains string `json:"tag-filter-contains,omitempty" yaml:"tag-filter-contains,omitempty"`
}
GitMonitor indicates using Git
func (*GitMonitor) GetFilterContains ¶ added in v0.13.6
func (gm *GitMonitor) GetFilterContains() string
GetFilterContains returns the substring filter to apply when searching tags in GitMonitor.
func (*GitMonitor) GetFilterPrefix ¶ added in v0.13.6
func (gm *GitMonitor) GetFilterPrefix() string
GetFilterPrefix returns the prefix filter to apply when searching tags in GitMonitor.
func (*GitMonitor) GetStripPrefix ¶ added in v0.11.3
func (gm *GitMonitor) GetStripPrefix() string
GetStripPrefix returns the prefix that should be stripped from the GitMonitor version.
func (*GitMonitor) GetStripSuffix ¶ added in v0.11.3
func (gm *GitMonitor) GetStripSuffix() string
GetStripSuffix returns the suffix that should be stripped from the GitMonitor version.
type Input ¶
type Input struct {
// Optional: The human-readable description of the input
Description string `json:"description,omitempty"`
// Optional: The default value of the input. Required when the input is.
Default string `json:"default,omitempty"`
// Optional: A toggle denoting whether the input is required or not
Required bool `json:"required,omitempty"`
}
type ListOption ¶
type ListOption struct {
Add []string `yaml:"add,omitempty"`
Remove []string `yaml:"remove,omitempty"`
}
ListOption describes an optional deviation to a list, for example, a list of packages.
type Package ¶
type Package struct {
// The name of the package
Name string `json:"name" yaml:"name"`
// The version of the package
Version string `json:"version" yaml:"version"`
// The monotone increasing epoch of the package
Epoch uint64 `json:"epoch" yaml:"epoch"`
// A human-readable description of the package
Description string `json:"description,omitempty" yaml:"description,omitempty"`
// Annotations for this package
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
// The URL to the package's homepage
URL string `json:"url,omitempty" yaml:"url,omitempty"`
// Optional: The git commit of the package build configuration
Commit string `json:"commit,omitempty" yaml:"commit,omitempty"`
// List of target architectures for which this package should be build for
TargetArchitecture []string `json:"target-architecture,omitempty" yaml:"target-architecture,omitempty"`
// The list of copyrights for this package
Copyright []Copyright `json:"copyright,omitempty" yaml:"copyright,omitempty"`
// List of packages to depends on
Dependencies Dependencies `json:"dependencies" yaml:"dependencies,omitempty"`
// Optional: Options that alter the packages behavior
Options *PackageOption `json:"options,omitempty" yaml:"options,omitempty"`
// Optional: Executable scripts that run at various stages of the package
// lifecycle, triggered by configurable events
Scriptlets *Scriptlets `json:"scriptlets,omitempty" yaml:"scriptlets,omitempty"`
// Optional: enabling, disabling, and configuration of build checks
Checks Checks `json:"checks" yaml:"checks,omitempty"`
// The CPE field values to be used for matching against NVD vulnerability
// records, if known.
CPE CPE `json:"cpe" yaml:"cpe,omitempty"`
// Capabilities to set after the pipeline completes.
SetCap []Capability `json:"setcap,omitempty" yaml:"setcap,omitempty"`
// Optional: The amount of time to allow this build to take before timing out.
Timeout time.Duration `json:"timeout,omitempty" yaml:"timeout,omitempty"`
// Optional: Resources to allocate to the build.
Resources *Resources `json:"resources,omitempty" yaml:"resources,omitempty"`
// Optional: Resources to allocate for test execution.
// Used by external schedulers (like elastic build) to provision
// appropriately-sized test pods/VMs. If not specified, falls back
// to Resources.
TestResources *Resources `json:"test-resources,omitempty" yaml:"test-resources,omitempty"`
}
func (Package) CPEString ¶ added in v0.21.2
CPEString returns the CPE string for the package, suitable for matching against NVD records.
func (Package) FullCopyright ¶
FullCopyright returns the concatenated copyright expressions defined in the configuration file.
func (Package) FullVersion ¶ added in v0.14.0
FullVersion returns the full version of the APK package produced by the build, including the epoch.
func (Package) LicenseExpression ¶
LicenseExpression returns an SPDX license expression formed from the data in the copyright structs found in the conf. It's a simple AND for now. Invalid SPDX license identifiers are converted to LicenseRef-<sanitized-name> format for SPDX compliance.
func (Package) LicensingInfos ¶ added in v0.8.0
func (p Package) LicensingInfos(ctx context.Context, workspaceDir string) (map[string]string, error)
LicensingInfos looks at the `Package.Copyright[].LicensePath` fields of the parsed build configuration for the package. If this value has been set, LicensingInfos opens the file at this path from the build's workspace directory, and reads in the license content. LicensingInfos then returns a map of the license identifier (using LicenseRef format for non-SPDX licenses) to the string content of the file from `.LicensePath`.
For licenses that are not valid SPDX identifiers, the extracted text will include the original license name if no LicensePath is specified. A warning is logged in this case to encourage providing the full license text.
func (Package) PackageURL ¶
func (p Package) PackageURL(distro, arch string) *purl.PackageURL
PackageURL returns the package URL ("purl") for the APK (origin) package.
func (Package) PackageURLForSubpackage ¶ added in v0.14.0
func (p Package) PackageURLForSubpackage(distro, arch, subpackage string) *purl.PackageURL
PackageURLForSubpackage returns the package URL ("purl") for the APK subpackage.
type PackageOption ¶
type PackageOption struct {
// Optional: Signify this package as a virtual package which does not provide
// any files, executables, libraries, etc... and is otherwise empty
NoProvides bool `json:"no-provides,omitempty" yaml:"no-provides,omitempty"`
// Optional: Mark this package as a self contained package that does not
// depend on any other package
NoDepends bool `json:"no-depends,omitempty" yaml:"no-depends,omitempty"`
// Optional: Mark this package as not providing any executables
NoCommands bool `json:"no-commands,omitempty" yaml:"no-commands,omitempty"`
// Optional: Don't generate versioned depends for shared libraries
NoVersionedShlibDeps bool `json:"no-versioned-shlib-deps,omitempty" yaml:"no-versioned-shlib-deps,omitempty"`
}
type Pipeline ¶
type Pipeline struct {
// Optional: A condition to evaluate before running the pipeline
If string `json:"if,omitempty" yaml:"if,omitempty"`
// Optional: A user defined name for the pipeline
Name string `json:"name,omitempty" yaml:"name,omitempty"`
// Optional: A named reusable pipeline to run
//
// This can be either a pipeline builtin to melange, or a user defined named pipeline.
// For example, to use a builtin melange pipeline:
// uses: autoconf/make
Uses string `json:"uses,omitempty" yaml:"uses,omitempty"`
// Optional: Arguments passed to the reusable pipelines defined in `uses`
With map[string]string `json:"with,omitempty" yaml:"with,omitempty"`
// Optional: The command to run using the builder's shell (/bin/sh)
Runs string `json:"runs,omitempty" yaml:"runs,omitempty"`
// Optional: The list of pipelines to run.
//
// Each pipeline runs in its own context that is not shared between other
// pipelines. To share context between pipelines, nest a pipeline within an
// existing pipeline. This can be useful when you wish to share common
// configuration, such as an alternative `working-directory`.
Pipeline []Pipeline `json:"pipeline,omitempty" yaml:"pipeline,omitempty"`
// Optional: A map of inputs to the pipeline
Inputs map[string]Input `json:"inputs,omitempty" yaml:"inputs,omitempty"`
// Optional: Configuration to determine any explicit dependencies this pipeline may have
Needs *Needs `json:"needs,omitempty" yaml:"needs,omitempty"`
// Optional: Labels to apply to the pipeline
Label string `json:"label,omitempty" yaml:"label,omitempty"`
// Optional: Assertions to evaluate whether the pipeline was successful
Assertions *PipelineAssertions `json:"assertions,omitempty" yaml:"assertions,omitempty"`
// Optional: The working directory of the pipeline
//
// This defaults to the guests' build workspace (/home/build)
WorkDir string `json:"working-directory,omitempty" yaml:"working-directory,omitempty"`
// Optional: environment variables to override apko
Environment map[string]string `json:"environment,omitempty" yaml:"environment,omitempty"`
}
func (Pipeline) SBOMPackageForUpstreamSource ¶ added in v0.14.0
func (p Pipeline) SBOMPackageForUpstreamSource(licenseDeclared, supplier string, uniqueID string) (*sbom.Package, error)
SBOMPackageForUpstreamSource returns an SBOM package for the upstream source of the package, if this Pipeline step was used to bring source code from an upstream project into the build. This function helps with generating SBOMs for the package being built. If the pipeline step is not a fetch or git-checkout step, this function returns nil and no error.
type PipelineAssertions ¶
type PipelineAssertions struct {
// The number (an int) of required steps that must complete successfully
// within the asserted pipeline.
RequiredSteps int `json:"required-steps,omitempty" yaml:"required-steps,omitempty"`
}
type ReleaseMonitor ¶
type ReleaseMonitor struct {
// Required: ID number for release monitor
Identifier int `json:"identifier" yaml:"identifier"`
// If the version in release monitor contains a prefix which should be ignored
StripPrefix string `json:"strip-prefix,omitempty" yaml:"strip-prefix,omitempty"`
// If the version in release monitor contains a suffix which should be ignored
StripSuffix string `json:"strip-suffix,omitempty" yaml:"strip-suffix,omitempty"`
// Filter to apply when searching version on a Release Monitoring
VersionFilterContains string `json:"version-filter-contains,omitempty" yaml:"version-filter-contains,omitempty"`
// Filter to apply when searching version Release Monitoring
VersionFilterPrefix string `json:"version-filter-prefix,omitempty" yaml:"version-filter-prefix,omitempty"`
}
ReleaseMonitor indicates using the API for https://release-monitoring.org/
func (*ReleaseMonitor) GetFilterContains ¶ added in v0.13.6
func (rm *ReleaseMonitor) GetFilterContains() string
GetFilterContains returns the substring filter to apply when searching versions in ReleaseMonitor.
func (*ReleaseMonitor) GetFilterPrefix ¶ added in v0.13.6
func (rm *ReleaseMonitor) GetFilterPrefix() string
GetFilterPrefix returns the prefix filter to apply when searching versions in ReleaseMonitor.
func (*ReleaseMonitor) GetStripPrefix ¶ added in v0.13.6
func (rm *ReleaseMonitor) GetStripPrefix() string
GetStripPrefix returns the prefix that should be stripped from the ReleaseMonitor version.
func (*ReleaseMonitor) GetStripSuffix ¶ added in v0.13.6
func (rm *ReleaseMonitor) GetStripSuffix() string
GetStripSuffix returns the suffix that should be stripped from the ReleaseMonitor version.
type Schedule ¶ added in v0.11.3
type Schedule struct {
// The reason scheduling is being used
Reason string `json:"reason,omitempty" yaml:"reason,omitempty"`
Period Period `json:"period,omitempty" yaml:"period,omitempty"`
}
Schedule defines the schedule for the update check to run
func (Schedule) GetScheduleMessage ¶ added in v0.12.1
type Scriptlets ¶
type Scriptlets struct {
// Optional: A script to run on a custom trigger
Trigger Trigger `json:"trigger" yaml:"trigger,omitempty"`
// Optional: The script to run pre install. The script should contain the
// shebang interpreter.
PreInstall string `json:"pre-install,omitempty" yaml:"pre-install,omitempty"`
// Optional: The script to run post install. The script should contain the
// shebang interpreter.
PostInstall string `json:"post-install,omitempty" yaml:"post-install,omitempty"`
// Optional: The script to run before uninstalling. The script should contain
// the shebang interpreter.
PreDeinstall string `json:"pre-deinstall,omitempty" yaml:"pre-deinstall,omitempty"`
// Optional: The script to run after uninstalling. The script should contain
// the shebang interpreter.
PostDeinstall string `json:"post-deinstall,omitempty" yaml:"post-deinstall,omitempty"`
// Optional: The script to run before upgrading. The script should contain
// the shebang interpreter.
PreUpgrade string `json:"pre-upgrade,omitempty" yaml:"pre-upgrade,omitempty"`
// Optional: The script to run after upgrading. The script should contain the
// shebang interpreter.
PostUpgrade string `json:"post-upgrade,omitempty" yaml:"post-upgrade,omitempty"`
}
type Subpackage ¶
type Subpackage struct {
// Optional: A conditional statement to evaluate for the subpackage
If string `json:"if,omitempty" yaml:"if,omitempty"`
// Optional: The iterable used to generate multiple subpackages
Range string `json:"range,omitempty" yaml:"range,omitempty"`
// Required: Name of the subpackage
Name string `json:"name" yaml:"name"`
// Optional: The list of pipelines that produce subpackage.
Pipeline []Pipeline `json:"pipeline,omitempty" yaml:"pipeline,omitempty"`
// Optional: List of packages to depend on
Dependencies Dependencies `json:"dependencies" yaml:"dependencies,omitempty"`
// Optional: Options that alter the packages behavior
Options *PackageOption `json:"options,omitempty" yaml:"options,omitempty"`
Scriptlets *Scriptlets `json:"scriptlets,omitempty" yaml:"scriptlets,omitempty"`
// Optional: The human readable description of the subpackage
Description string `json:"description,omitempty" yaml:"description,omitempty"`
// Optional: The URL to the package's homepage
URL string `json:"url,omitempty" yaml:"url,omitempty"`
// Optional: The git commit of the subpackage build configuration
Commit string `json:"commit,omitempty" yaml:"commit,omitempty"`
// Optional: enabling, disabling, and configuration of build checks
Checks Checks `json:"checks" yaml:"checks,omitempty"`
// Test section for the subpackage.
Test *Test `json:"test,omitempty" yaml:"test,omitempty"`
// Capabilities to set after the pipeline completes.
SetCap []Capability `json:"setcap,omitempty" yaml:"setcap,omitempty"`
}
type Test ¶ added in v0.5.4
type Test struct {
// Additional Environment necessary for test.
// Environment.Contents.Packages automatically get
// package.dependencies.runtime added to it. So, if your test needs
// no additional packages, you can leave it blank.
// Optional: Additional Environment the test needs to run
Environment apko_types.ImageConfiguration `json:"environment" yaml:"environment,omitempty"`
// Required: The list of pipelines that test the produced package.
Pipeline []Pipeline `json:"pipeline" yaml:"pipeline"`
}
type Update ¶
type Update struct {
// Toggle if updates should occur
Enabled bool `json:"enabled" yaml:"enabled"`
// Indicates that this package should be manually updated, usually taking
// care over special version numbers
Manual bool `json:"manual,omitempty" yaml:"manual"`
// Indicates that automated pull requests should be merged in order rather than superseding and closing previous unmerged PRs
RequireSequential bool `json:"require-sequential,omitempty" yaml:"require-sequential"`
// downstream dependencies, e.g. golang, java
Shared bool `json:"shared,omitempty" yaml:"shared,omitempty"`
// Override the version separator if it is nonstandard
VersionSeparator string `json:"version-separator,omitempty" yaml:"version-separator,omitempty"`
// A slice of regex patterns to match an upstream version and ignore
IgnoreRegexPatterns []string `json:"ignore-regex-patterns,omitempty" yaml:"ignore-regex-patterns,omitempty"`
// The configuration block for updates tracked via release-monitoring.org
ReleaseMonitor *ReleaseMonitor `json:"release-monitor,omitempty" yaml:"release-monitor,omitempty"`
// The configuration block for updates tracked via the Github API
GitHubMonitor *GitHubMonitor `json:"github,omitempty" yaml:"github,omitempty"`
// The configuration block for updates tracked via Git
GitMonitor *GitMonitor `json:"git,omitempty" yaml:"git,omitempty"`
// The configuration block for transforming the `package.version` into an APK version
VersionTransform []VersionTransform `json:"version-transform,omitempty" yaml:"version-transform,omitempty"`
// ExcludeReason is required if enabled=false, to explain why updates are disabled.
ExcludeReason string `json:"exclude-reason,omitempty" yaml:"exclude-reason,omitempty"`
// Schedule defines the schedule for the update check to run
Schedule *Schedule `json:"schedule,omitempty" yaml:"schedule,omitempty"`
// Optional: Disables filtering of common pre-release tags
EnablePreReleaseTags bool `json:"enable-prerelease-tags,omitempty" yaml:"enable-prerelease-tags,omitempty"`
}
Update provides information used to describe how to keep the package up to date
type VarTransforms ¶
type VarTransforms struct {
// Required: The original template variable.
//
// Example: ${{package.version}}
From string `json:"from" yaml:"from"`
// Required: The regular expression to match against the `from` variable
Match string `json:"match" yaml:"match"`
// Required: The repl to replace on all `match` matches
Replace string `json:"replace" yaml:"replace"`
// Required: The name of the new variable to create
//
// Example: mangeled-package-version
To string `json:"to" yaml:"to"`
}
type VersionHandler ¶ added in v0.11.3
type VersionHandler interface {
GetStripPrefix() string
GetStripSuffix() string
GetFilterPrefix() string
GetFilterContains() string
}
VersionHandler is an interface that defines methods for retrieving version filtering and stripping parameters. It is used to provide a common interface for handling version-related operations for different types of version monitors.
type VersionTransform ¶
type VersionTransform struct {
// Required: The regular expression to match against the `package.version` variable
Match string `json:"match" yaml:"match"`
// Required: The repl to replace on all `match` matches
Replace string `json:"replace" yaml:"replace"`
}
VersionTransform allows mapping the package version to an APK version