promotion

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package promotion provides a skeleton for environment promotion workflows (e.g. staging → production) built on workflow definitions. Steps are app-supplied; this package only names phases and builds a definition shell.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidArg = errors.New("promotion: invalid argument")

Functions

func BuildDefinition

func BuildDefinition(cfg Config) (*workflow.Definition, error)

BuildDefinition constructs a validated workflow Definition for promotion.

Types

type Config

type Config struct {
	Name    string // workflow name; default "promote"
	FromEnv string
	ToEnv   string
	Hooks   Hooks
}

Config names the workflow and wires hooks.

type Hooks

type Hooks struct {
	Validate workflow.ActionFunc
	Prepare  workflow.ActionFunc
	Promote  workflow.ActionFunc
	Verify   workflow.ActionFunc
	Rollback workflow.CompensateFunc // compensates Promote
}

Hooks are app-supplied promotion actions.

type Phase

type Phase string

Phase names the promotion lifecycle (documentation / attrs only).

const (
	PhasePlan       Phase = "plan"
	PhaseValidate   Phase = "validate"
	PhasePrepare    Phase = "prepare"
	PhasePromote    Phase = "promote"
	PhaseVerify     Phase = "verify"
	PhaseComplete   Phase = "complete"
	PhaseCompensate Phase = "compensate"
)

Jump to

Keyboard shortcuts

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