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
- func ImageSource(image string) ([]byte, error)
- func ParseProcfile(s string) (map[string]string, error)
- func Processes(procfile map[string]string, entrypoint, cmd []string) (map[string][]string, error)
- type ImageBuilder
- type Pipeline
- func (p *Pipeline) Deploy(ctx context.Context, d *types.Deploy, sourcePath string, log func(string)) error
- func (p *Pipeline) Logs(ctx context.Context, app string, o types.LogOptions, line func(string)) error
- func (p *Pipeline) PS(ctx context.Context, app, action, actor string, log func(string)) error
- func (p *Pipeline) RoutesChanged()
- type Settings
- type Source
Constants ¶
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 ¶
ImageSource is the source tarball for an image deploy.
func ParseProcfile ¶
ParseProcfile parses "type: command" lines, ignoring blanks and comments.
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) PS ¶
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.