Documentation
¶
Index ¶
Constants ¶
const StatePath = ".stagefreight/pipeline.json"
StatePath is the workspace-relative path where pipeline state is persisted.
Variables ¶
This section is empty.
Functions ¶
func UpdateState ¶
UpdateState does read-modify-write. The caller mutates individual fields only — never rebuild nested structs wholesale to avoid clobbering prior state written by other subsystems.
func WriteState ¶
WriteState writes pipeline state atomically (tmp + rename). Normalizes Version to 1 on write.
Types ¶
type BuildState ¶
type BuildState struct {
Attempted bool `json:"attempted"`
Completed bool `json:"completed"`
ProducedImages bool `json:"produced_images"`
PublishedCount int `json:"published_count"`
ManifestPath string `json:"manifest_path,omitempty"`
Reason string `json:"reason,omitempty"`
}
BuildState records what the build subsystem did.
type CIState ¶
type CIState struct {
Provider string `json:"provider"`
PipelineID string `json:"pipeline_id"`
Ref string `json:"ref,omitempty"`
Branch string `json:"branch,omitempty"`
Tag string `json:"tag,omitempty"`
SHA string `json:"sha"`
}
CIState captures the CI environment for this pipeline run.
func InitFromCI ¶
InitFromCI populates a CIState from a ci.CIContext.
type ReleaseState ¶
type ReleaseState struct {
Eligible bool `json:"eligible"`
Attempted bool `json:"attempted"`
Completed bool `json:"completed"`
Skipped bool `json:"skipped"`
Reason string `json:"reason,omitempty"`
}
ReleaseState records what the release subsystem did.
type SecurityState ¶
type SecurityState struct {
Attempted bool `json:"attempted"`
Completed bool `json:"completed"`
Skipped bool `json:"skipped"`
Reason string `json:"reason,omitempty"`
}
SecurityState records what the security subsystem did.
type State ¶
type State struct {
Version int `json:"version"`
CI CIState `json:"ci"`
Build BuildState `json:"build"`
Security SecurityState `json:"security"`
Release ReleaseState `json:"release"`
}
State is the per-run ledger for the current pipeline workspace. Each subsystem records what it did; downstream stages read the ledger instead of probing files.