Documentation
¶
Index ¶
- Variables
- type Build
- type Command
- type Config
- func (c *Config) CommandNames() []string
- func (c *Config) ContextName(server *Server) string
- func (c *Config) EnvFilesFor(svc *Service) []string
- func (c *Config) GetCommand(name string) (*Command, error)
- func (c *Config) GetServer(name string) (*Server, error)
- func (c *Config) GetService(name string) (*Service, error)
- func (c *Config) ServerNames() []string
- func (c *Config) ServiceNames() []string
- type Env
- type Health
- type Hook
- type HookType
- type Preview
- type Proxy
- type Registry
- type Server
- type Service
Constants ¶
This section is empty.
Variables ¶
var HookTypes = []HookType{HookPreBuild, HookPreDeploy, HookPostDeploy, HookPostAppBoot}
HookTypes lists all lifecycle hooks in execution order.
Functions ¶
This section is empty.
Types ¶
type Build ¶
type Build struct {
Method string `yaml:"method"` // "remote" | "pull" | "" (auto per service)
Retain int `yaml:"retain"` // stopped old-version containers kept per service
}
Build configures how images get onto servers.
type Command ¶
type Command struct {
Name string `yaml:"-"`
Description string `yaml:"description"`
Service string `yaml:"service"` // runs inside this service's container...
Server string `yaml:"server"` // ...or on a host
Command string `yaml:"command"`
Interactive bool `yaml:"interactive"`
}
Command is a user-defined command for `ferry run`.
type Config ¶
type Config struct {
Name string `yaml:"name"`
Compose []string `yaml:"compose"`
Servers map[string]*Server `yaml:"servers"`
Proxy Proxy `yaml:"proxy"`
Build Build `yaml:"build"`
Registry *Registry `yaml:"registry"`
Env Env `yaml:"env"`
Services map[string]*Service `yaml:"services"`
Preview Preview `yaml:"preview"`
Hooks map[HookType]Hook `yaml:"hooks"`
Commands map[string]*Command `yaml:"commands"`
// Dir is the directory containing ferry.yaml; relative paths resolve
// against it.
Dir string `yaml:"-"`
}
Config is the parsed ferry.yaml.
func (*Config) CommandNames ¶
CommandNames returns sorted command names.
func (*Config) ContextName ¶
ContextName returns the Docker context name for a server.
func (*Config) EnvFilesFor ¶
EnvFilesFor returns the env files (global first, then service overlay) for a service, resolved against the config dir. Missing global file is only an error when explicitly configured.
func (*Config) GetCommand ¶
GetCommand returns a custom command by name.
func (*Config) GetService ¶
GetService returns a service overlay by name.
func (*Config) ServerNames ¶
ServerNames returns sorted server names.
func (*Config) ServiceNames ¶
ServiceNames returns sorted service names.
type Env ¶
type Env struct {
File string `yaml:"file"`
Encryption string `yaml:"encryption"` // "none" | "sops-age"
}
Env configures environment delivery.
type Health ¶
type Health struct {
Path string `yaml:"path"`
Interval string `yaml:"interval"`
Timeout string `yaml:"timeout"`
}
Health maps to kamal-proxy --health-check-* flags.
type Hook ¶
type Hook []string
Hook is a list of entries; each entry is either a path to a script file or an inline shell command.
type HookType ¶
type HookType string
HookType represents lifecycle hook types
const ( HookPreBuild HookType = "pre_build" // Local, before building HookPreDeploy HookType = "pre_deploy" // Remote, after image exists on host, before cutover HookPostDeploy HookType = "post_deploy" // Remote, after cutover HookPostAppBoot HookType = "post_app_boot" // Remote, after the proxy reports the target live )
type Preview ¶
type Preview struct {
Domain string `yaml:"domain"`
Server string `yaml:"server"`
Services []string `yaml:"services"`
Isolate []string `yaml:"isolate"`
EnvFile string `yaml:"env_file"`
TTL string `yaml:"ttl"`
}
Preview configures preview deployments.
type Proxy ¶
type Proxy struct {
Image string `yaml:"image"`
Network string `yaml:"network"`
HTTPPort int `yaml:"http_port"`
HTTPSPort int `yaml:"https_port"`
}
Proxy configures kamal-proxy (one container per proxied server).
type Registry ¶
type Registry struct {
Server string `yaml:"server"`
Username string `yaml:"username"`
Password string `yaml:"password"` // name of a variable in the env file, never a literal
}
Registry configures a registry for build method "pull" with private images.
type Server ¶
type Server struct {
Name string `yaml:"-"`
Host string `yaml:"host"`
User string `yaml:"user"`
Port int `yaml:"port"`
}
Server is one target machine. Each server becomes a Docker context named ferry-<name>. SSH auth comes from the system SSH config.
type Service ¶
type Service struct {
Name string `yaml:"-"`
Servers []string `yaml:"servers"`
Domain string `yaml:"domain"`
Domains []string `yaml:"domains"`
Port int `yaml:"port"`
Health Health `yaml:"health"`
Proxy map[string]string `yaml:"proxy"` // passthrough kamal-proxy deploy flags
EnvFile string `yaml:"env_file"`
Build string `yaml:"build"` // per-service override of build.method
Job bool `yaml:"job"`
Stateful bool `yaml:"stateful"` // converge in place: stable container, recreated only on config change
}
Service is the ferry.yaml overlay on a compose service. The key must exist in the compose project.
func (*Service) AllDomains ¶
AllDomains returns domain + domains merged.