definition

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyValue

type KeyValue map[string]string

func (KeyValue) String

func (kv KeyValue) String() string

type OnErrorTaskDef added in v1.3.0

type OnErrorTaskDef struct {
	// Script is a list of shell commands that are executed if an error occurs in a "normal" task
	Script []string `yaml:"script"`

	// Env sets/overrides environment variables for this task (takes precedence over pipeline environment)
	Env map[string]string `yaml:"env"`
}

OnErrorTaskDef is a special task definition to be executed solely if an error occurs during "normal" task handling.

type PipelineDef

type PipelineDef struct {
	// Concurrency declares how many instances of this pipeline are allowed to execute concurrently (defaults to 1)
	Concurrency int `yaml:"concurrency"`
	// QueueLimit is the number of slots for queueing jobs if the allowed concurrency is exceeded, defaults to unbounded (nil)
	QueueLimit *int `yaml:"queue_limit"`
	// QueueStrategy to use when adding jobs to the queue (defaults to append)
	QueueStrategy QueueStrategy `yaml:"queue_strategy"`
	// StartDelay will delay the start of a job if the value is greater than zero (defaults to 0)
	StartDelay time.Duration `yaml:"start_delay"`

	// ContinueRunningTasksAfterFailure should be set to true if you want to continue working through all jobs whose
	// predecessors have not failed. false by default; so by default, if the first job aborts, all others are terminated as well.
	ContinueRunningTasksAfterFailure bool `yaml:"continue_running_tasks_after_failure"`

	RetentionPeriod time.Duration `yaml:"retention_period"`
	RetentionCount  int           `yaml:"retention_count"`

	// Env sets/overrides environment variables for all tasks (takes precedence over process environment)
	Env map[string]string `yaml:"env"`

	// Tasks is a map of task names to task definitions
	Tasks map[string]TaskDef `yaml:"tasks"`

	// Task to be added and executed if this pipeline fails, e.g. for notifications.
	//
	// In this task, you have the following variables set:
	// - failedTaskName: Name of the failed task (key from pipelines.yml)
	// - failedTaskExitCode: Exit code of the failed task
	// - failedTaskError: Error message of the failed task
	// - failedTaskStdout: Stdout of the failed task
	// - failedTaskStderr: Stderr of the failed task
	OnError *OnErrorTaskDef `yaml:"on_error"`

	// SourcePath stores the source path where the pipeline was defined
	SourcePath string
}

func (PipelineDef) Equals added in v0.8.1

func (d PipelineDef) Equals(otherDef PipelineDef) bool

type PipelinesDef

type PipelinesDef struct {
	Pipelines PipelinesMap `yaml:"pipelines"`
}

func LoadRecursively

func LoadRecursively(pattern string) (*PipelinesDef, error)

func (*PipelinesDef) Equals added in v0.8.1

func (d *PipelinesDef) Equals(otherDefs PipelinesDef) bool

func (*PipelinesDef) Load

func (d *PipelinesDef) Load(path string) (err error)

func (*PipelinesDef) Validate added in v0.5.0

func (d *PipelinesDef) Validate() error

type PipelinesMap

type PipelinesMap map[string]PipelineDef

func (PipelinesMap) NamesWithSourcePath

func (m PipelinesMap) NamesWithSourcePath() KeyValue

type QueueStrategy

type QueueStrategy int
const (
	// QueueStrategyAppend appends jobs to the queue until queue limit is reached
	QueueStrategyAppend QueueStrategy = 0
	// QueueStrategyReplace replaces pending jobs (with same variables) instead of appending to the queue
	QueueStrategyReplace QueueStrategy = 1
)

func (*QueueStrategy) UnmarshalYAML

func (s *QueueStrategy) UnmarshalYAML(unmarshal func(interface{}) error) error

type TaskDef

type TaskDef struct {
	// Script is a list of shell commands that are executed for this task
	Script []string `yaml:"script"`
	// DependsOn is a list of task names this task depends on (must be finished before it can start)
	DependsOn []string `yaml:"depends_on"`
	// AllowFailure should be set, if the pipeline should continue event if this task had an error
	AllowFailure bool `yaml:"allow_failure"`

	// Env sets/overrides environment variables for this task (takes precedence over pipeline environment)
	Env map[string]string `yaml:"env"`
}

func (TaskDef) Equals added in v0.8.1

func (d TaskDef) Equals(otherDef TaskDef) bool

Jump to

Keyboard shortcuts

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