target

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DependsOn    []string `yaml:"depends_on"`
	Name         string
	PipelineID   string `yaml:"pipelineID"` // PipelineID references a unique pipeline run allowing to group targets
	SCMID        string `yaml:"scmID"`      // SCMID references a unique scm configuration
	Kind         string
	Prefix       string // Deprecated in favor of Transformers on 2021/01/3
	Postfix      string // Deprecated in favor of Transformers on 2021/01/3
	ReportTitle  string // ReportTitle contains the updatecli reports title for sources and conditions run
	ReportBody   string // ReportBody contains the updatecli reports body for sources and conditions run
	Transformers transformer.Transformers
	Spec         interface{}
	Scm          map[string]interface{} // Deprecated field on version [x.y.z]
	SourceID     string                 `yaml:"sourceID"`
}

Config defines target parameters

type Options

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

Options hold target parameters

type Target

type Target struct {
	Result string // Result store the condition result after a target run. This variable can't be set by an updatecli configuration
	Config Config
	Commit bool
	Push   bool
	Clean  bool
	DryRun bool
	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

type Targeter

type Targeter interface {
	Target(source string, dryRun bool) (bool, error)
	TargetFromSCM(source string, scm scm.ScmHandler, dryRun bool) (changed bool, files []string, message string, err error)
}

Targeter is an interface which offers common function to manipulate targets.

func Unmarshal

func Unmarshal(target *Target) (targeter Targeter, err error)

Unmarshal decodes a target struct

Jump to

Keyboard shortcuts

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