Documentation
¶
Overview ¶
Package config loads and validates .onair.yml. The same shape can be built programmatically by a host - this package exists only for the CLI's zero-code path.
Index ¶
Constants ¶
const DefaultFileName = ".onair.yml"
DefaultFileName is what Find looks for, walking up from the working directory the way git finds its root.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Component ¶
type Component struct {
Name string `yaml:"name"`
Live *LiveSource `yaml:"live"`
}
Component configures one deployable unit and its live source.
type Environment ¶
type Environment struct {
// Environment names the GitLab environment whose deployment records are
// Live for every component here without a live source of its own.
Environment string `yaml:"environment"`
Components []Component `yaml:"components"`
}
Environment is one deploy target: a named ordered list of components.
type File ¶
type File struct {
Project string `yaml:"project"`
Forge Forge `yaml:"forge"`
Attribution onair.AttributionMode `yaml:"attribution"` // off | on | auto (default auto)
Identities map[string][]string `yaml:"identities"`
// Task decodes through yaml's lowercased field names: pattern, url.
Task *onair.TaskConfig `yaml:"task"`
Environments map[string]Environment `yaml:"environments"`
}
File is the parsed .onair.yml.
type Forge ¶
type Forge struct {
Kind string `yaml:"kind"` // default "gitlab"
Repo string `yaml:"repo"`
Branch string `yaml:"branch"` // empty: onair.Collect's default
BaseURL string `yaml:"base_url"` // default per kind (gitlab.com)
// TokenEnv names the environment variable holding the API token;
// default "GITLAB_TOKEN". The token itself never lives in the file.
TokenEnv string `yaml:"token_env"`
}
Forge names the git host and project.
type LiveSource ¶
type LiveSource struct {
Probe string `yaml:"probe"` // /-/version URL
Command string `yaml:"command"` // stdout is the answer (see docs/command-contract.md)
// Environment is a GitLab environment whose newest successful
// deployment is Live (Recorded confidence).
Environment string `yaml:"environment"`
}
LiveSource picks at most one live provider. An absent `live` key inherits the environment's deployment records; `live: {}` opts out of them, leaving Assumed = Green. A bare `live:` (YAML null) is rejected, because it reads as either.