Documentation
¶
Overview ¶
Package plan merges the compose project with the ferry.yaml overlay into resolved deploy targets. Compose is the source of truth for what a service is; ferry.yaml adds where it runs and how it is exposed.
Index ¶
- type Plan
- func (p *Plan) CrossServerEnv(target *Target, server *config.Server) map[string]string
- func (p *Plan) PreviewDomain() (string, error)
- func (p *Plan) PreviewServer() (*config.Server, error)
- func (p *Plan) PreviewServices() ([]*Target, error)
- func (p *Plan) Select(names []string) ([]*Target, error)
- func (p *Plan) Target(name string) (*Target, error)
- func (p *Plan) Warnings() []string
- type Target
- func (t *Target) BuildContextDir() string
- func (t *Target) BuildMethod() string
- func (t *Target) Config() *config.Config
- func (t *Target) ContainerName(version string) string
- func (t *Target) DomainsOn(server *config.Server) []string
- func (t *Target) ImageRef(version string) string
- func (t *Target) Port() int
- func (t *Target) Proxied() bool
- func (t *Target) ProxyService() string
- func (t *Target) RunsOn(server *config.Server) bool
- func (t *Target) Stateful() bool
- func (t *Target) Versioned() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Plan ¶
Plan is the fully resolved deployment model, targets in dependency order.
func (*Plan) CrossServerEnv ¶
CrossServerEnv returns FERRY_SERVICE_<NAME>_HOST entries for every other deployed service that does not run on the given server — the 12-factor escape hatch since Docker networks don't span hosts.
func (*Plan) PreviewDomain ¶
PreviewDomain returns the base domain previews hang off: preview.domain, else the primary service domain, else an sslip.io fallback.
func (*Plan) PreviewServer ¶
PreviewServer resolves the preview server: preview.server, else the first server of the first proxied service.
func (*Plan) PreviewServices ¶
PreviewServices returns the targets deployed by `ferry preview` (preview.services, default all), in dependency order.
type Target ¶
type Target struct {
Name string
Overlay *config.Service
Compose types.ServiceConfig
Servers []*config.Server
// contains filtered or unexported fields
}
Target is one deployable service: a compose service plus its overlay, resolved against concrete servers.
func (*Target) BuildContextDir ¶
BuildContextDir returns the absolute build context directory for a versioned service (shipping it to a build host needs the real path).
func (*Target) BuildMethod ¶
BuildMethod resolves to "remote" or "pull": per-service override, global build.method, else remote when compose has build:. Image-only services (postgres:16, ...) are always pull — there is nothing to build.
func (*Target) ContainerName ¶
ContainerName returns the versioned container name (Kamal-style: no renames, no color juggling). Stateful services get a stable, project- prefixed name instead (container names are host-global): their lifecycle follows config changes, not app versions.
func (*Target) DomainsOn ¶
DomainsOn returns the domains for this service on a given server; without configured domains it falls back to <service>.<ip-with-dashes>.sslip.io so first contact needs zero DNS setup.
func (*Target) Port ¶
Port returns the container port the proxy targets: the overlay port, else the first compose expose entry, else the first compose ports target.
func (*Target) Proxied ¶
Proxied reports whether the service is registered with kamal-proxy: it has a domain, or an explicit port (which gets an sslip.io fallback domain).
func (*Target) ProxyService ¶
ProxyService returns the kamal-proxy service name, prefixed with the project name: kamal-proxy keys registrations by service name globally per server, so two projects sharing a server with a same-named service would otherwise clobber each other's routing and TLS host allowlist.