promote

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package promote implements staging-to-production promotion with diff preview and rollback.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Rollback

func Rollback(ctx context.Context, projectDir, backupTag string) error

Rollback restores to the pre-promotion backup tag.

Types

type DiffEntry

type DiffEntry struct {
	Key         string `json:"key"`
	SourceValue string `json:"source_value"`
	TargetValue string `json:"target_value"`
	Status      string `json:"status"` // added, removed, changed, same
}

DiffEntry represents a single difference between environments.

type DiffResult

type DiffResult struct {
	Source     string      `json:"source"`
	Target     string      `json:"target"`
	Migrations []DiffEntry `json:"migrations"`
	EnvVars    []DiffEntry `json:"env_vars"`
	Images     []DiffEntry `json:"images"`
	Metadata   []DiffEntry `json:"metadata"`
	Timestamp  time.Time   `json:"timestamp"`
}

DiffResult holds the comparison between two environments.

func DryRun

func DryRun(ctx context.Context, projectDir, source, target string) (*DiffResult, error)

DryRun computes the diff between source and target environments.

type PromotionRecord

type PromotionRecord struct {
	ID          string    `json:"id"`
	Source      string    `json:"source"`
	Target      string    `json:"target"`
	ApproveID   string    `json:"approve_id"`
	BackupTag   string    `json:"backup_tag"`
	StartedAt   time.Time `json:"started_at"`
	CompletedAt time.Time `json:"completed_at"`
	Status      string    `json:"status"` // success, failed, rolled_back
	Error       string    `json:"error,omitempty"`
}

PromotionRecord records an executed promotion.

func Execute

func Execute(ctx context.Context, projectDir, source, target, approveID string) (*PromotionRecord, error)

Execute runs the full promotion pipeline.

Jump to

Keyboard shortcuts

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