Documentation
¶
Index ¶
- Constants
- func DiscoverConfigs(dir string) ([]string, error)
- func IsConfigFileName(name string) bool
- func ValidateConfig(cfg *Config) error
- type ArtifactsConfig
- type BootstrapConfig
- type CacheConfig
- type CleanupConfig
- type Config
- type ConfigValidator
- type Duration
- type ExtendsList
- type JobBootstrapConfig
- type JobCleanupConfig
- type JobConfig
- type MatrixEntry
- type NameList
- type NetworkConfig
- type RemoteProvider
- type ServiceConfig
- type ServiceReady
Constants ¶
const CanonicalConfigName = ".local-ci.yaml"
CanonicalConfigName is the default config file the CLI and server look for when nothing else is selected.
Variables ¶
This section is empty.
Functions ¶
func DiscoverConfigs ¶ added in v0.2.0
DiscoverConfigs lists the local-ci config files present in dir (basenames only, not full paths). The canonical ".local-ci.yaml"/".local-ci.yml" sorts first; the rest follow case-insensitively. A missing or unreadable dir is reported as an error.
func IsConfigFileName ¶ added in v0.2.0
IsConfigFileName reports whether name looks like a local-ci config file: the canonical ".local-ci.yaml"/".local-ci.yml", a bare "local-ci.yaml", or any "<prefix>.local-ci.yaml" / "<prefix>-local-ci.yaml" / "<prefix>_local-ci.yaml" variant (and the .yml spellings). The separator requirement keeps unrelated names like "nonlocal-ci.yaml" out.
func ValidateConfig ¶
Types ¶
type ArtifactsConfig ¶ added in v0.2.1
type ArtifactsConfig struct {
Paths []string `yaml:"paths"`
}
ArtifactsConfig declares files a job produces for later jobs: after the job succeeds, the listed paths (relative to the job's workdir) are copied out of its container and injected into the workspace of every subsequent job.
type BootstrapConfig ¶ added in v0.0.20
type CacheConfig ¶
type CleanupConfig ¶ added in v0.0.23
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 (*Config) LoadConfig ¶
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 Duration ¶ added in v0.2.1
Duration is a YAML-friendly wrapper over time.Duration. It accepts either a Go duration string ("90s", "10m", "1h30m") or a bare integer, which is read as seconds.
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 JobCleanupConfig ¶ added in v0.0.23
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"`
Timeout Duration `yaml:"timeout,omitempty"`
Retry int `yaml:"retry,omitempty"`
Services []ServiceConfig `yaml:"services,omitempty"`
Artifacts *ArtifactsConfig `yaml:"artifacts,omitempty"`
Needs NameList `yaml:"needs,omitempty"`
}
func ExpandMatrix ¶ added in v0.1.1
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
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
func (*MatrixEntry) UnmarshalYAML ¶ added in v0.1.1
func (m *MatrixEntry) UnmarshalYAML(node *yaml.Node) error
type NameList ¶ added in v0.2.1
type NameList []string
NameList is a YAML field accepting a single name or a list of names (`needs: build` or `needs: [build, lint]`).
type NetworkConfig ¶ added in v0.0.8
type RemoteProvider ¶ added in v0.0.17
type ServiceConfig ¶ added in v0.2.1
type ServiceConfig struct {
Image string `yaml:"image"`
Alias string `yaml:"alias,omitempty"`
Variables map[string]string `yaml:"variables,omitempty"`
Ready *ServiceReady `yaml:"ready,omitempty"`
}
ServiceConfig declares a sidecar container that runs for the duration of a job (a database, a cache, ...). The engine starts it on a per-job network before the job's script and tears it down after, so the job reaches it at its alias (e.g. postgres://db:5432). Unlike job_bootstrap — host-side commands that run to completion — a service is an engine-managed daemon with its own image, lifecycle, and readiness gate.
func (*ServiceConfig) EffectiveAlias ¶ added in v0.2.1
func (s *ServiceConfig) EffectiveAlias() string
EffectiveAlias is the network hostname the job reaches the service at: the explicit alias, or the image's last path segment without tag/digest (registry.example.com/group/postgres:16 → "postgres").
func (*ServiceConfig) UnmarshalYAML ¶ added in v0.2.1
func (s *ServiceConfig) UnmarshalYAML(node *yaml.Node) error
UnmarshalYAML accepts either the full mapping form or the string shorthand `- postgres:16`, which sets the image and derives the alias.
type ServiceReady ¶ added in v0.2.1
type ServiceReady struct {
Command string `yaml:"command,omitempty"`
Timeout Duration `yaml:"timeout,omitempty"`
}
ServiceReady gates the job's start on the service being usable. With a command, the engine execs it inside the service container until it exits 0. Without one, it waits for the image's HEALTHCHECK (when defined) or for the container to be running.