deploy

package
v0.8.22 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package deploy turns source into releases and rolls them out:

inspect source -> build rootfs -> release -> rollout

A rollout is Dokku's zero-downtime deploy: boot the new release's instances, wait for them to pass checks, switch the proxy to them, and stop the old instances after wait-to-retire. If checks fail, the new instances are stopped and the old release keeps serving.

Index

Constants

View Source
const SourceImage = "image"

SourceImage is the deploy source of builder:image: a registry image, built from a one-line Dockerfile, "FROM <image>".

Variables

This section is empty.

Functions

func ImageSource

func ImageSource(image string) ([]byte, error)

ImageSource is the source tarball for an image deploy.

func ParseProcfile

func ParseProcfile(s string) (map[string]string, error)

ParseProcfile parses "type: command" lines, ignoring blanks and comments.

func Processes

func Processes(procfile map[string]string, entrypoint, cmd []string) (map[string][]string, error)

Processes maps each process type to its argv. Without a Procfile, the app has one "web" process: the image's ENTRYPOINT + CMD. Procfile commands run through /bin/sh (so $PORT expands), after the ENTRYPOINT if there is one, the way "docker run image <command>" would.

Types

type ImageBuilder

type ImageBuilder interface {
	Build(ctx context.Context, o build.Options, log func(string)) (*build.Result, error)
	Unpack(ctx context.Context, deployID int64, source string) (string, error)
	BuildTarget(ctx context.Context, deployID int64, t build.Target, logins []build.RegistryLogin, log func(string)) (*build.Result, error)
}

ImageBuilder makes root filesystems: a *build.Builder, or a fake in tests.

type Pipeline

type Pipeline struct {
	Store   *store.Store
	Builder ImageBuilder
	Cluster *cluster.Controller
	DataDir string
	Log     *slog.Logger
}

func (*Pipeline) Deploy

func (p *Pipeline) Deploy(ctx context.Context, d *types.Deploy, sourcePath string, log func(string)) error

func (*Pipeline) Logs

func (p *Pipeline) Logs(ctx context.Context, app string, o types.LogOptions, line func(string)) error

func (*Pipeline) PS

func (p *Pipeline) PS(ctx context.Context, app, action, actor string, log func(string)) error

PS runs a "ps:" action: restart, start, stop or rebuild, or apply (roll out settings changes, restarting only process types they change). Start wakes a sleeping app.

func (*Pipeline) RoutesChanged

func (p *Pipeline) RoutesChanged()

RoutesChanged applies domain and proxy setting changes right away.

type Settings

type Settings struct {
	Builder        string // dockerfile, compose or image
	BuildDir       string
	DockerfilePath string
	ProcfilePath   string
	ComposeFile    string // "" finds the usual names
	Image          string // what an image app runs
}

Settings are the build-related properties resolved for one app.

type Source

type Source struct {
	Dockerfile string            // path of the Dockerfile inside the tarball
	Procfile   map[string]string // process type -> command; nil without a Procfile
}

Source is what Inspect learned about a source tarball.

func Inspect

func Inspect(app, tarPath string, s Settings) (*Source, error)

Inspect checks app's source tarball has a Dockerfile and reads its Procfile.

Jump to

Keyboard shortcuts

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