pipelines

package
v0.0.0-...-045286d Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PipelineNameLabel is a label that indicates a resource is part of a Pipeline.
	PipelineNameLabel = "gitops.pro/pipeline"

	// PipelineEnvironmentabel is a label that indicates which stage a component
	// is from within a Pipeline.
	PipelineEnvironmentLabel = "gitops.pro/pipeline-environment"

	// PipelineEnvironmentAfterLabel is a label that indicates which stage a
	// component follows within a pipeline.
	PipelineEnvironmentAfterLabel = "gitops.pro/pipeline-after"
)

Variables

This section is empty.

Functions

func OrderEnvironments

func OrderEnvironments(o []environment) ([]string, error)

OrderEnvironments takes a set pairs of named environments and their preceeding environment and calculates the ordering.

If more than one environment has no dependent environments, the ordering will be non-deterministic, all dependent environments will be in order.

func WithLabels

func WithLabels(pipeline, environment, after string) func(*Parser)

WithLabels is a functional option for configuring the Parser with a set of labels.

Types

type Labels

type Labels struct {
	Pipeline    string
	Environment string
	After       string
}

Labels configures the set of labels to examine resources for.

type Parser

type Parser struct {
	Labels Labels
	// contains filtered or unexported fields
}

Parser parses the labels and annotations on runtime Objects and extracts apps from the labels.

func NewParser

func NewParser(opts ...func(*Parser)) *Parser

NewParser creates and returns a new Parser ready for use.

func (*Parser) Add

func (p *Parser) Add(list []runtime.Object) error

Add accepts a list of objects and records them for parsing with the Pipelines method.

func (*Parser) Pipelines

func (p *Parser) Pipelines() ([]Pipeline, error)

Pipelines returns the discovered pipelines.

The environments are ordered based on the configuration of pipeline after labels.

type Pipeline

type Pipeline struct {
	Name         string
	Environments []string
}

Pipeline is a Continuous-Delivery pipeline with a sequence of environments that an application change passes through.

Jump to

Keyboard shortcuts

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