config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateConfig

func ValidateConfig(cfg *Config) error

Types

type BootstrapConfig added in v0.0.20

type BootstrapConfig struct {
	Run     []string `yaml:"run"`
	Timeout int      `yaml:"timeout,omitempty"`
}

type CacheConfig

type CacheConfig struct {
	Key   string   `yaml:"key"`
	Paths []string `yaml:"paths"`
}

type CleanupConfig added in v0.0.23

type CleanupConfig struct {
	Run     []string `yaml:"run"`
	Timeout int      `yaml:"timeout,omitempty"`
}

type Config

type Config struct {
	FileName        string
	Stages          []string          `yaml:"stages"`
	Jobs            []JobConfig       `yaml:"-"`
	GlobalVariables map[string]string `yaml:"variables,omitempty"`
	RemoteProvider  *RemoteProvider   `yaml:"remote_provider,omitempty"`
	CLIVariables    map[string]string `yaml:"-"`
	Bootstrap       *BootstrapConfig  `yaml:"bootstrap,omitempty"`
	Cleanup         *CleanupConfig    `yaml:"cleanup,omitempty"`
	Include         []string          `yaml:"include,omitempty"`
}

func NewConfig

func NewConfig(file string) *Config

func (*Config) LoadConfig

func (c *Config) LoadConfig() error

func (*Config) UnmarshalYAML added in v0.0.17

func (c *Config) UnmarshalYAML(node *yaml.Node) error

type ConfigValidator added in v0.0.23

type ConfigValidator struct {
	// contains filtered or unexported fields
}

func NewConfigValidator added in v0.0.23

func NewConfigValidator(cfg *Config) *ConfigValidator

func (*ConfigValidator) Validate added in v0.0.23

func (v *ConfigValidator) Validate() error

type ExtendsList added in v0.1.2

type ExtendsList []string

func (*ExtendsList) UnmarshalYAML added in v0.1.2

func (e *ExtendsList) UnmarshalYAML(node *yaml.Node) error

type JobBootstrapConfig added in v0.0.23

type JobBootstrapConfig struct {
	Run     []string `yaml:"run"`
	Timeout int      `yaml:"timeout,omitempty"`
}

type JobCleanupConfig added in v0.0.23

type JobCleanupConfig struct {
	Run     []string `yaml:"run"`
	Timeout int      `yaml:"timeout,omitempty"`
}

type JobConfig

type JobConfig struct {
	Name         string              `yaml:"-"`
	Image        string              `yaml:"image"`
	Script       []string            `yaml:"script"`
	Stage        string              `yaml:"stage"`
	Workdir      string              `yaml:"workdir,omitempty"`
	Variables    map[string]string   `yaml:"variables,omitempty"`
	Cache        *CacheConfig        `yaml:"cache,omitempty"`
	Network      *NetworkConfig      `yaml:"network,omitempty"`
	JobBootstrap *JobBootstrapConfig `yaml:"job_bootstrap,omitempty"`
	JobCleanup   *JobCleanupConfig   `yaml:"job_cleanup,omitempty"`
	Parallel     *bool               `yaml:"parallel,omitempty"`
	Matrix       []MatrixEntry       `yaml:"matrix,omitempty"`
	MatrixGroup  string              `yaml:"-"`
	Extends      ExtendsList         `yaml:"extends,omitempty"`
}

func ExpandMatrix added in v0.1.1

func ExpandMatrix(job JobConfig) ([]JobConfig, error)

ExpandMatrix returns the variants generated by a job's matrix definition. If the job has no matrix, it returns the job unchanged in a single-element slice. Each variant has a unique Name (suffixed with key.value pairs), a fresh Variables map containing the parent's variables plus the matrix values, and a MatrixGroup field set to the original job name.

func (*JobConfig) IsParallel added in v0.1.2

func (j *JobConfig) IsParallel() bool

IsParallel returns true only when the job has explicitly opted into the per-job parallel mode (`parallel: true`). A nil pointer (no `parallel:` key in YAML) or an explicit `parallel: false` both report false.

type MatrixEntry added in v0.1.1

type MatrixEntry map[string][]string

func (*MatrixEntry) UnmarshalYAML added in v0.1.1

func (m *MatrixEntry) UnmarshalYAML(node *yaml.Node) error

type NetworkConfig added in v0.0.8

type NetworkConfig struct {
	HostAccess bool `yaml:"host_access,omitempty"`
	HostMode   bool `yaml:"host_mode,omitempty"`
}

type RemoteProvider added in v0.0.17

type RemoteProvider struct {
	Url       string `yaml:"url"`
	ProjectId int    `yaml:"project_id"`
	Token     string `yaml:"access_token"`
}

Jump to

Keyboard shortcuts

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