Documentation
¶
Index ¶
- Variables
- func NewSSHClient(server Server) (*ssh.Client, error)
- type AttachContainerRole
- type BootstrapAppDirRole
- type BootstrapFerryRole
- type BuildLocalDockerImageRole
- type CleanAppServiceRole
- type CleanUpDeployRole
- type CommandManager
- type Config
- type CtxKey
- type DeployTraefikServiceRole
- type ErrorHandler
- type ExecDockerCommandRole
- type GetContainerNameRole
- type HealthCheck
- type InitTraefikServiceRole
- type InstallDockerRole
- type InstallSopsRole
- type NextIndex
- type PrepareDeployRole
- type PrepareDockerRole
- type PullDockerImageRole
- type RemoveAppServiceRole
- type RenewCertificateRole
- type ResponseHandler
- type Role
- type Server
- type ShowDockerLogsRole
- type StopTraefikServiceRole
- type Task
- func (t Task) IgnoreError() Task
- func (t Task) PersistOutput(name CtxKey) Task
- func (t Task) SetInteractive() Task
- func (t Task) SetRemote(remote bool) Task
- func (t Task) SkipByOnError(increment int) Task
- func (t Task) SkipByOnOutputMatch(increment int, match string) Task
- func (t Task) Stdout() Task
- func (t Task) ThrowDockerErrors() Task
- func (t Task) Wait(delay int) Task
- func (t Task) WithErrorHandler(handler ErrorHandler) Task
- func (t Task) WithResponseHandler(handler ResponseHandler) Task
- type UpdateEnvVarsRole
- type Volume
Constants ¶
This section is empty.
Variables ¶
View Source
var Attach = []Role{ &GetContainerNameRole{}, &AttachContainerRole{}, }
View Source
var CleanCmnds = []Role{ &CleanAppServiceRole{}, }
View Source
var Deploy = []Role{ &BootstrapAppDirRole{}, &PullDockerImageRole{}, &BuildLocalDockerImageRole{}, &PrepareDeployRole{}, &PrepareDockerRole{}, &DeployTraefikServiceRole{}, &CleanUpDeployRole{}, }
View Source
var Exec = []Role{ &ExecDockerCommandRole{}, }
View Source
var Logger = prettyconsole.NewLogger(zap.DebugLevel)
View Source
var Logs = []Role{ &GetContainerNameRole{}, &ShowDockerLogsRole{}, }
View Source
var RemoveCmnds = []Role{ &RemoveAppServiceRole{}, }
View Source
var Setup = []Role{ &InstallDockerRole{}, &BootstrapFerryRole{}, &InitTraefikServiceRole{}, }
Functions ¶
Types ¶
type AttachContainerRole ¶
type AttachContainerRole struct{}
func (*AttachContainerRole) BuildTasks ¶
func (*AttachContainerRole) Description ¶
func (s *AttachContainerRole) Description() string
type BootstrapAppDirRole ¶
type BootstrapAppDirRole struct{}
func (*BootstrapAppDirRole) BuildTasks ¶
func (*BootstrapAppDirRole) Description ¶
func (s *BootstrapAppDirRole) Description() string
type BootstrapFerryRole ¶
type BootstrapFerryRole struct{}
func (*BootstrapFerryRole) BuildTasks ¶
func (*BootstrapFerryRole) Description ¶
func (s *BootstrapFerryRole) Description() string
type BuildLocalDockerImageRole ¶
type BuildLocalDockerImageRole struct{}
func (*BuildLocalDockerImageRole) BuildTasks ¶
func (*BuildLocalDockerImageRole) Description ¶
func (s *BuildLocalDockerImageRole) Description() string
type CleanAppServiceRole ¶
type CleanAppServiceRole struct{}
func (*CleanAppServiceRole) BuildTasks ¶
func (*CleanAppServiceRole) Description ¶
func (s *CleanAppServiceRole) Description() string
type CleanUpDeployRole ¶
type CleanUpDeployRole struct{}
func (*CleanUpDeployRole) BuildTasks ¶
func (*CleanUpDeployRole) Description ¶
func (s *CleanUpDeployRole) Description() string
type CommandManager ¶
type CommandManager struct {
// contains filtered or unexported fields
}
func NewCommandManager ¶
func NewCommandManager(config Config) *CommandManager
func (*CommandManager) Run ¶
func (c *CommandManager) Run(roles []Role) error
type Config ¶
type Config struct {
DeployMethod string `yaml:"deploy_method" default:"pull"`
Domain string `yaml:"domain"`
CertResolver string `yaml:"cert_resolver"`
Health HealthCheck `yaml:"health"`
Image string `yaml:"image"`
Servers []Server `yaml:"servers"`
ContainerName string `yaml:"container_name" default:"app"`
EnvFile string `yaml:"env_file" default:"./.env"`
DockerFile string `yaml:"docker_file" default:"./Dockerfile"`
DockerContext string `yaml:"docker_context" default:"./"`
Port int `yaml:"port" default:"3000"`
Type string `yaml:"type" default:"app"`
Networks []string `yaml:"networks" default:"traefik-public"`
}
type DeployTraefikServiceRole ¶
type DeployTraefikServiceRole struct{}
func (*DeployTraefikServiceRole) BuildTasks ¶
func (*DeployTraefikServiceRole) Description ¶
func (s *DeployTraefikServiceRole) Description() string
type ErrorHandler ¶
type ExecDockerCommandRole ¶
type ExecDockerCommandRole struct {
// contains filtered or unexported fields
}
func (*ExecDockerCommandRole) BuildTasks ¶
func (*ExecDockerCommandRole) Description ¶
func (s *ExecDockerCommandRole) Description() string
type GetContainerNameRole ¶
type GetContainerNameRole struct{}
func (*GetContainerNameRole) BuildTasks ¶
Get the container name (either app_name+blue or app_name+green) from the context, using the app_name
func (*GetContainerNameRole) Description ¶
func (s *GetContainerNameRole) Description() string
type HealthCheck ¶
type InitTraefikServiceRole ¶
type InitTraefikServiceRole struct{}
func (*InitTraefikServiceRole) BuildTasks ¶
func (*InitTraefikServiceRole) Description ¶
func (s *InitTraefikServiceRole) Description() string
type InstallDockerRole ¶
type InstallDockerRole struct{}
func (*InstallDockerRole) BuildTasks ¶
func (*InstallDockerRole) Description ¶
func (s *InstallDockerRole) Description() string
type InstallSopsRole ¶
type InstallSopsRole struct{}
func (*InstallSopsRole) BuildTasks ¶
func (*InstallSopsRole) Description ¶
func (s *InstallSopsRole) Description() string
type PrepareDeployRole ¶
type PrepareDeployRole struct{}
func (*PrepareDeployRole) BuildTasks ¶
func (*PrepareDeployRole) Description ¶
func (s *PrepareDeployRole) Description() string
type PrepareDockerRole ¶
type PrepareDockerRole struct{}
func (*PrepareDockerRole) BuildTasks ¶
func (*PrepareDockerRole) Description ¶
func (s *PrepareDockerRole) Description() string
type PullDockerImageRole ¶
type PullDockerImageRole struct{}
func (*PullDockerImageRole) BuildTasks ¶
func (*PullDockerImageRole) Description ¶
func (s *PullDockerImageRole) Description() string
type RemoveAppServiceRole ¶
type RemoveAppServiceRole struct{}
func (*RemoveAppServiceRole) BuildTasks ¶
func (*RemoveAppServiceRole) Description ¶
func (s *RemoveAppServiceRole) Description() string
type RenewCertificateRole ¶
type RenewCertificateRole struct{}
func (*RenewCertificateRole) BuildTasks ¶
func (*RenewCertificateRole) Description ¶
func (s *RenewCertificateRole) Description() string
type ResponseHandler ¶
type Role ¶
type Role interface {
BuildTasks(cfg Config, ctx context.Context, server Server) []Task
Description() string
}
type ShowDockerLogsRole ¶
type ShowDockerLogsRole struct{}
func (*ShowDockerLogsRole) BuildTasks ¶
func (*ShowDockerLogsRole) Description ¶
func (s *ShowDockerLogsRole) Description() string
type StopTraefikServiceRole ¶
type StopTraefikServiceRole struct{}
func (*StopTraefikServiceRole) BuildTasks ¶
func (*StopTraefikServiceRole) Description ¶
func (s *StopTraefikServiceRole) Description() string
type Task ¶
type Task struct {
// Name is the name of the task. It's used in logs to identify the task.
Name string
// Interactive determines if the task should be run in interactive mode.
Interactive bool
// The command to run.
Command string
// ResponseHandler will determine how the app should react to the command output
ResponseHandler ResponseHandler
// ErrorHandler will determine how the app should react to the command error
ErrorHandler ErrorHandler
// Remote determines if the task should be run on a remote server or locally.
Remote bool
// GetNextTaskIndex is a function that will be called to determine the next task index.
NextIndex NextIndex
PipeStdout bool
}
func (Task) IgnoreError ¶
func (Task) PersistOutput ¶
func (Task) SetInteractive ¶
func (Task) SkipByOnError ¶
func (Task) SkipByOnOutputMatch ¶
func (Task) ThrowDockerErrors ¶
func (Task) WithErrorHandler ¶
func (t Task) WithErrorHandler(handler ErrorHandler) Task
func (Task) WithResponseHandler ¶
func (t Task) WithResponseHandler(handler ResponseHandler) Task
type UpdateEnvVarsRole ¶
type UpdateEnvVarsRole struct{}
func (*UpdateEnvVarsRole) BuildTasks ¶
func (*UpdateEnvVarsRole) Description ¶
func (s *UpdateEnvVarsRole) Description() string
Click to show internal directories.
Click to hide internal directories.