pipeline

package
v0.93.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const (
	GraphFlavorDot     = "dot"
	GraphFlavorMermaid = "mermaid"
)

Define constants for valid GraphFlavor values

Variables

View Source
var (
	// ErrNotValidDependsOn is triggered when we define a nonexistent depends on value.
	ErrNotValidDependsOn = errors.New("no valid depends_on value")
	// ErrDependsOnLoopDetected is triggered when we define a dependency loop.
	ErrDependsOnLoopDetected = errors.New("dependency loop detected")
)
View Source
var (
	// CheckedPipelines is used to avoid checking the same action multiple times across different pipelines
	CheckedPipelines []string
)
View Source
var (
	// ErrRunTargets is return when at least one error happened during targets execution
	ErrRunTargets error = errors.New("something went wrong during target execution")
)

Functions

func ExtractDepsFromTemplate added in v0.86.0

func ExtractDepsFromTemplate(tmplStr string) ([]string, error)

ExtractCustomKeys parses a Go template and extracts custom keys from specific template actions: {{ source "sourceId" }}, {{ condition "conditionid" }}, and {{ target "targetid" }}. It returns a map where the keys are the action types ("source", "condition", "target") and the values are slices of strings representing the IDs extracted from the corresponding actions in the template.

func ValidateGraphFlavor added in v0.88.0

func ValidateGraphFlavor(flavor string) error

ValidateGraphFlavor checks if the GraphFlavor value is valid

Types

type Dependency added in v0.86.0

type Dependency struct {
	ID       string
	Operator string
}

type Node added in v0.86.0

type Node struct {
	ID              string
	Category        string
	DependsOn       []Dependency
	DependsOnChange bool
	Result          string
	Changed         bool
}

type Options added in v0.11.0

type Options struct {
	Target target.Options
}

type Pipeline

type Pipeline struct {
	// Name defines a pipeline name, used to improve human visualization
	Name string
	// ID allows to identify a full pipeline run, this value is propagated into each target if not defined at that level
	ID string
	// Sources contains all sources defined in the configuration
	Sources map[string]source.Source
	// Conditions contains all conditions defined in the configuration
	Conditions map[string]condition.Condition
	// Targets contains all targets defined in the configuration
	Targets map[string]target.Target
	// SCMs contains all scms defined in the configuration
	SCMs map[string]scm.Scm
	// Actions contains all actions defined in the configuration
	Actions map[string]action.Action
	// Report contains the pipeline report
	Report reports.Report
	// Options contains all updatecli options for this specific pipeline
	Options Options
	// Config contains the pipeline configuration defined by the user
	Config *config.Config
	// contains filtered or unexported fields
}

Pipeline represent an updatecli run for a specific configuration

func (*Pipeline) GetTargetsIDByResult added in v0.17.0

func (p *Pipeline) GetTargetsIDByResult(targetIDs []string) (
	failedTargetsID, attentionTargetsID, successTargetsID, skippedTargetsID []string)

GetTargetsIDByResult return a list of target ID per result type

func (*Pipeline) Graph added in v0.86.0

func (p *Pipeline) Graph(flavor string) error

func (*Pipeline) Init

func (p *Pipeline) Init(config *config.Config, options Options) error

Init initialize an updatecli context based on its configuration

func (*Pipeline) Run added in v0.11.0

func (p *Pipeline) Run() error

Run execute an single pipeline

func (*Pipeline) RunActions added in v0.40.0

func (p *Pipeline) RunActions() error

RunActions runs all actions defined in the configuration.

func (*Pipeline) RunCleanActions added in v0.76.1

func (p *Pipeline) RunCleanActions() error

RunCleanActions executes clean up operation which depends on the action plugin.

func (*Pipeline) RunCondition added in v0.86.0

func (p *Pipeline) RunCondition(id string) (r string, err error)

func (*Pipeline) RunSource added in v0.86.0

func (p *Pipeline) RunSource(id string) (r string, err error)

func (*Pipeline) RunTarget added in v0.86.0

func (p *Pipeline) RunTarget(id string) (r string, changed bool, err error)

RunTarget run a target by id

func (*Pipeline) SortedResources added in v0.86.0

func (p *Pipeline) SortedResources() (result *dag.DAG, err error)

SortedResources return a list of resources by building a DAG

func (*Pipeline) String

func (p *Pipeline) String() string

func (*Pipeline) Update added in v0.44.0

func (p *Pipeline) Update() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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