agent

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerRecreate

type ContainerRecreate struct {
	Name string `yaml:"name"`
}

ContainerRecreate stops+removes a container so a webhook can recreate it. Non-fatal.

func (ContainerRecreate) Exec

func (cr ContainerRecreate) Exec(c *runCtx) error

type DockerBuild

type DockerBuild struct {
	Tag string `yaml:"tag"`
}

DockerBuild builds the repo into a tagged image.

func (DockerBuild) Exec

func (d DockerBuild) Exec(c *runCtx) error

type Executor

type Executor struct {
	Repo   string
	Steps  []Step
	Runner func(name string, args ...string) (string, error)
}

Executor runs an ordered list of steps and produces a DeployResponse.

func NewExecutor

func NewExecutor(repo string, steps []Step) *Executor

NewExecutor builds an Executor with the default real-command runner.

func (*Executor) Run

func (e *Executor) Run() contract.DeployResponse

Run executes steps in order, stopping at the first failure, and returns the result.

type GitPull

type GitPull struct{}

GitPull pulls the repo, records from/to short hashes, and flags a no-op pull.

func (GitPull) Exec

func (GitPull) Exec(c *runCtx) error

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler is the deploy-agent HTTP endpoint: bearer-auth, single-flight, runs a pipeline.

func NewHandler

func NewHandler(secret string, run func() contract.DeployResponse) *Handler

NewHandler wires a deploy handler around a pipeline-run function.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Shell

type Shell struct {
	Run string `yaml:"run"`
	Dir string `yaml:"dir"`
}

Shell runs an arbitrary command — the escape hatch (e.g. regenerate endpoints).

func (Shell) Exec

func (sh Shell) Exec(c *runCtx) error

type Step

type Step interface {
	Exec(c *runCtx) error
}

Step is one unit of a deploy pipeline.

func ParseConfig

func ParseConfig(data []byte) (string, []Step, error)

ParseConfig turns deploy-agent.yaml bytes into a repo path and ordered steps.

type Webhook

type Webhook struct {
	URL    string `yaml:"url"`
	URLEnv string `yaml:"url_env"`
}

Webhook POSTs to a URL (literal or resolved from an env var). Non-2xx fails.

func (Webhook) Exec

func (wh Webhook) Exec(c *runCtx) error

Jump to

Keyboard shortcuts

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