deploy

package
v0.2.0-preview.2 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(value any) ([]byte, error)

Types

type Manager

type Manager struct {
	Operator     Operator
	Now          func() time.Time
	Prepare      func(config.Config, string, string, string) (string, error)
	Inspect      func(config.Config, string, string, string) error
	ReadIdentity func(string) (releaseIdentity, error)
	OperationID  func() (string, error)
	AppendEvent  func(string, eventlog.Event) error
	Sleep        func(context.Context, time.Duration) error
}

func NewManager

func NewManager(operator Operator) Manager

func (Manager) Deploy

func (m Manager) Deploy(ctx context.Context, cfg config.Config, request Request) (Report, error)

func (Manager) Prune

func (m Manager) Prune(cfg config.Config, keep int, apply bool) ([]string, error)

func (Manager) Rollback

func (m Manager) Rollback(ctx context.Context, cfg config.Config) (state.Record, error)

func (Manager) Status

func (m Manager) Status(ctx context.Context, cfg config.Config) (Status, error)

type Operator

type Operator interface {
	Restart(context.Context, string) error
	Stop(context.Context, string) error
	IsActive(context.Context, string) (bool, error)
	StartCandidate(context.Context, string, string, string, map[string]string) error
	ValidateCaddy(context.Context, string) error
	ReloadCaddy(context.Context) error
	Probe(context.Context, string, string, string, string) error
	ProbeURL(context.Context, string, string) error
}

type Report

type Report struct {
	Validated       bool   `json:"validated"`
	Mutation        string `json:"mutation"`
	Release         string `json:"release,omitempty"`
	ActiveRelease   string `json:"active_release,omitempty"`
	PreviousRelease string `json:"previous_release,omitempty"`
	EventWarnings   int    `json:"event_warnings,omitempty"`
}

type Request

type Request struct {
	Artifact       string
	SHA256         string
	ApprovedSHA256 string
	Activate       bool
}

type Status

type Status struct {
	State            *state.Record   `json:"state,omitempty"`
	Units            map[string]bool `json:"units"`
	StateInitialized bool            `json:"state_initialized"`
}

type SystemOperator

type SystemOperator struct {
	Runner  process.Runner
	Timeout time.Duration
}

func (SystemOperator) IsActive

func (o SystemOperator) IsActive(ctx context.Context, unit string) (bool, error)

func (SystemOperator) Probe

func (o SystemOperator) Probe(ctx context.Context, address, host, path, contains string) error

func (SystemOperator) ProbeURL

func (o SystemOperator) ProbeURL(ctx context.Context, value, contains string) error

func (SystemOperator) ReloadCaddy

func (o SystemOperator) ReloadCaddy(ctx context.Context) error

func (SystemOperator) Restart

func (o SystemOperator) Restart(ctx context.Context, unit string) error

func (SystemOperator) StartCandidate

func (o SystemOperator) StartCandidate(ctx context.Context, unit, binary, environmentFile string, env map[string]string) error

func (SystemOperator) Stop

func (o SystemOperator) Stop(ctx context.Context, unit string) error

func (SystemOperator) ValidateCaddy

func (o SystemOperator) ValidateCaddy(ctx context.Context, path string) error

Jump to

Keyboard shortcuts

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