target

package
v0.55.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrWrongConfig is returned when a target spec has missing attributes which are mandatory
	ErrWrongConfig = errors.New("wrong target configuration")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// ResourceConfig defines target input parameters
	resource.ResourceConfig `yaml:",inline"`
	// ReportTitle contains the updatecli reports title for sources and conditions run
	ReportTitle string `yaml:",omitempty"`
	// ReportBody contains the updatecli reports body for sources and conditions run
	ReportBody string `yaml:",omitempty"`
	// ! Deprecated - please use all lowercase `sourceid`
	DeprecatedSourceID string `yaml:"sourceID,omitempty" jsonschema:"-"`
	// disablesourceinput disables the mechanism to retrieve a default value from a source. For example, if true, source information like changelog will not be accessible for a github/pullrequest action.
	DisableSourceInput bool `yaml:",omitempty"`
	// sourceid specifies where retrieving the default value
	SourceID string `yaml:",omitempty"`
}

Config defines target parameters

func (Config) JSONSchema added in v0.23.0

func (Config) JSONSchema() *jschema.Schema

JSONSchema implements the json schema interface to generate the "target" jsonschema.

func (*Config) Validate added in v0.23.0

func (c *Config) Validate() error

Validate checks if a target configuration is valid

type Options

type Options struct {
	Commit bool
	Push   bool
	Clean  bool
	DryRun bool
}

Options hold target parameters

type Target

type Target struct {
	// Result store the condition result after a target run.
	Result result.Target
	// Config defines target input parameters
	Config Config
	// Commit defines if a target was executed in Commit mode
	Commit bool
	// Push defines if a target was executed in Push mode
	Push bool
	// Clean defines if a target was executed in Clean mode
	Clean bool
	// DryRun defines if a target was executed in DryRun mode
	DryRun bool
	// Scm stores scm information
	Scm *scm.ScmHandler
}

Target defines which file needs to be updated based on source output

func (*Target) Check

func (t *Target) Check() (bool, error)

Check verifies if mandatory Targets parameters are provided and return false if not.

func (*Target) Run

func (t *Target) Run(source string, o *Options) (err error)

Run applies a specific target configuration

Jump to

Keyboard shortcuts

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