config

package
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 21 Imported by: 19

Documentation

Index

Constants

View Source
const (
	SubstitutionPackageName           = "${{package.name}}"
	SubstitutionPackageVersion        = "${{package.version}}"
	SubstitutionPackageFullVersion    = "${{package.full-version}}"
	SubstitutionPackageEpoch          = "${{package.epoch}}"
	SubstitutionPackageDescription    = "${{package.description}}"
	SubstitutionTargetsOutdir         = "${{targets.outdir}}"
	SubstitutionTargetsDestdir        = "${{targets.destdir}}"
	SubstitutionTargetsContextdir     = "${{targets.contextdir}}"
	SubstitutionSubPkgDir             = "${{targets.subpkgdir}}"
	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

This section is empty.

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 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
	Environment apko_types.ImageConfiguration `json:"environment" yaml:"environment"`
	// 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,omitempty" 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
}

The root melange configuration

func ParseConfiguration

func ParseConfiguration(_ 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 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 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"`
}

type DataItems

type DataItems map[string]string

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 Needs

type Needs struct {
	// A list of packages needed by this pipeline
	Packages []string
}

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"`
	// 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,omitempty" 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,omitempty" yaml:"checks,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"`
}

func (Package) FullCopyright

func (p Package) FullCopyright() string

FullCopyright returns the concatenated copyright expressions defined in the configuration file.

func (Package) FullVersion added in v0.14.0

func (p Package) FullVersion() string

FullVersion returns the full version of the APK package produced by the build, including the epoch.

func (Package) LicenseExpression

func (p Package) LicenseExpression() string

LicenseExpression returns an SPDX license expression formed from the data in the copyright structs found in the conf. It's a simple OR for now.

func (Package) LicensingInfos added in v0.8.0

func (p Package) LicensingInfos(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 `Copyright.License` field to the string content of the file from `.LicensePath`.

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" yaml:"no-provides"`
	// Optional: Mark this package as a self contained package that does not
	// depend on any other package
	NoDepends bool `json:"no-depends" yaml:"no-depends"`
	// Optional: Mark this package as not providing any executables
	NoCommands bool `json:"no-commands" yaml:"no-commands"`
}

type Period added in v0.11.3

type Period string

Period represents the update check period

const (
	Daily   Period = "daily"
	Weekly  Period = "weekly"
	Monthly Period = "monthly"
)

type Pipeline

type Pipeline struct {
	// 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: A condition to evaluate before running the pipeline
	If string `json:"if,omitempty" yaml:"if,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 the apko environment
	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) (*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 RangeData

type RangeData struct {
	Name  string    `json:"name" yaml:"name"`
	Items DataItems `json:"items" yaml:"items"`
}

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 Resources added in v0.5.4

type Resources struct {
	CPU    string `json:"cpu,omitempty" yaml:"cpu,omitempty"`
	Memory string `json:"memory,omitempty" yaml:"memory,omitempty"`
	Disk   string `json:"disk,omitempty" yaml:"disk,omitempty"`
}

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

func (schedule Schedule) GetScheduleMessage() (string, error)

type Scriptlets

type Scriptlets struct {
	// Optional: A script to run on a custom trigger
	Trigger Trigger `json:"trigger,omitempty" 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,omitempty" 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,omitempty" yaml:"checks,omitempty"`
	// Test section for the subpackage.
	Test *Test `json:"test,omitempty" yaml:"test,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.
	Environment apko_types.ImageConfiguration `json:"environment" yaml:"environment"`

	// Required: The list of pipelines that test the produced package.
	Pipeline []Pipeline `json:"pipeline" yaml:"pipeline"`
}

type Trigger added in v0.7.0

type Trigger struct {
	// Optional: The script to run
	Script string `json:"script,omitempty"`
	// Optional: The list of paths to monitor to trigger the script
	Paths []string `json:"paths,omitempty"`
}

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"`
	// Indicate that an update to this package requires an epoch bump of
	// 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"`
}

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

Jump to

Keyboard shortcuts

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