Documentation ¶
Index ¶
- func FindProjectConfigFilePath() (string, error)
- type BaseCommand
- func (cmd *BaseCommand) Before(c *cli.Context) error
- func (cmd *BaseCommand) Failure(message string, errorName string, exitCode int) error
- func (cmd *BaseCommand) NewContext(name string, flags []cli.Flag, parent *cli.Context) *cli.Context
- func (cmd *BaseCommand) SetContextFlag(ctx *cli.Context, name string, value string)
- func (cmd *BaseCommand) Success(message string) error
- type ComposeFile
- type Config
- type DNS
- type DNSRecords
- type Dashboard
- type DataBackup
- type DataRestore
- type Dev
- type Doctor
- type Kill
- type Machine
- func (m *Machine) CheckXhyveRequirements() error
- func (m *Machine) Create(driver string, cpuCount string, memSize string, diskSize string, isoURL string) error
- func (m *Machine) Exists() bool
- func (m *Machine) GetBridgeIP() string
- func (m *Machine) GetCPU() int
- func (m *Machine) GetData() *simplejson.Json
- func (m *Machine) GetDisk() int
- func (m *Machine) GetDiskInGB() int
- func (m *Machine) GetDockerVersion() (*version.Version, error)
- func (m *Machine) GetDriver() string
- func (m *Machine) GetHostDNSResolver() bool
- func (m *Machine) GetIP() string
- func (m *Machine) GetMemory() int
- func (m *Machine) GetSysctl(setting string) (string, error)
- func (m *Machine) IsRunning() bool
- func (m *Machine) IsXhyve() bool
- func (m *Machine) Remove() error
- func (m *Machine) SetEnv()
- func (m *Machine) SetSysctl(key string, val string) error
- func (m *Machine) Start() error
- func (m *Machine) Stop() error
- func (m *Machine) UnsetEnv()
- func (m *Machine) WaitForDev() error
- type Project
- type ProjectConfig
- type ProjectCreate
- type ProjectScript
- func (p *ProjectScript) Capture(script *Script, extra []string) (string, int, error)
- func (p *ProjectScript) CreateCommand(steps, extra []string, workingDirectory string) *exec.Cmd
- func (p *ProjectScript) GetCommand(steps, extra []string, workingDirectory string) *exec.Cmd
- func (p *ProjectScript) GetWorkingDirectory() string
- func (p *ProjectScript) Run(script *Script, extra []string) int
- type ProjectSync
- func (cmd *ProjectSync) Commands() []cli.Command
- func (cmd *ProjectSync) DeriveLocalSyncPath(config *ProjectConfig, override string) (string, error)
- func (cmd *ProjectSync) GetVolumeName(config *ProjectConfig, workingDir string) string
- func (cmd *ProjectSync) LoadComposeFile() (*ComposeFile, error)
- func (cmd *ProjectSync) LogFileName(name string) string
- func (cmd *ProjectSync) RunCheck(ctx *cli.Context) error
- func (cmd *ProjectSync) RunName(ctx *cli.Context) error
- func (cmd *ProjectSync) RunPurge(ctx *cli.Context) error
- func (cmd *ProjectSync) RunStart(ctx *cli.Context) error
- func (cmd *ProjectSync) RunStop(ctx *cli.Context) error
- func (cmd *ProjectSync) SetupBindVolume(volumeName string, workingDir string) error
- func (cmd *ProjectSync) StartUnisonSync(ctx *cli.Context, volumeName string, config *ProjectConfig, workingDir string) error
- func (cmd *ProjectSync) WaitForSyncInit(logFile string, workingDir string, timeoutSeconds int, syncWaitSeconds int) error
- func (cmd *ProjectSync) WaitForUnisonContainer(containerName string, timeoutSeconds int) (string, error)
- type Prune
- type Remove
- type RigCommand
- type SSH
- type Script
- type Start
- type Status
- type Stop
- type Sync
- type Upgrade
- type Volume
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindProjectConfigFilePath ¶
FindProjectConfigFilePath traverses directory structure looking for an outrigger project config file.
Types ¶
type BaseCommand ¶
type BaseCommand struct { RigCommand // contains filtered or unexported fields }
BaseCommand is parent for all rig commands
func (*BaseCommand) Before ¶
func (cmd *BaseCommand) Before(c *cli.Context) error
Before configure the function to run before all commands to setup core services.
func (*BaseCommand) Failure ¶
func (cmd *BaseCommand) Failure(message string, errorName string, exitCode int) error
Failure encapsulates the functionality for reporting command failure
func (*BaseCommand) NewContext ¶
NewContext creates a new Context struct to pass along to delegate commands
func (*BaseCommand) SetContextFlag ¶
func (cmd *BaseCommand) SetContextFlag(ctx *cli.Context, name string, value string)
SetContextFlag set a flag on the provided context
func (*BaseCommand) Success ¶
func (cmd *BaseCommand) Success(message string) error
Success encapsulates the functionality for reporting command success
type ComposeFile ¶
ComposeFile is a minimal compose file struct to discover volumes
type Config ¶
type Config struct {
BaseCommand
}
Config is the command for setting docker config to talk to a Docker Machine
type DNS ¶
type DNS struct {
BaseCommand
}
DNS is the command for starting all DNS services and appropriate network routing to access services
func (*DNS) ConfigureRoutes ¶
ConfigureRoutes will configure routing to allow access to containers on IP addresses within the Docker Machine bridge network
type DNSRecords ¶
type DNSRecords struct {
BaseCommand
}
DNSRecords is the command for exporting all DNS Records in Outrigger DNS in `hosts` file format
func (*DNSRecords) Commands ¶
func (cmd *DNSRecords) Commands() []cli.Command
Commands returns the operations supported by this command
func (*DNSRecords) LoadRecords ¶
func (cmd *DNSRecords) LoadRecords() ([]map[string]interface{}, error)
LoadRecords retrieves the records from DNSDock and processes/return them
type Dashboard ¶
type Dashboard struct {
BaseCommand
}
Dashboard is the command for launching the Outrigger Dashboard
func (*Dashboard) LaunchDashboard ¶
LaunchDashboard launches the dashboard, stopping it first for a clean automatic update
func (*Dashboard) StopDashboard ¶
func (cmd *Dashboard) StopDashboard()
StopDashboard stops and removes the dashboard container
type DataBackup ¶
type DataBackup struct {
BaseCommand
}
DataBackup is the command for backing up the /data directory within the Docker Machine
func (*DataBackup) Commands ¶
func (cmd *DataBackup) Commands() []cli.Command
Commands returns the operations supported by this command
type DataRestore ¶
type DataRestore struct {
BaseCommand
}
DataRestore is the command for restoring up the /data directory within the Docker Machine
func (*DataRestore) Commands ¶
func (cmd *DataRestore) Commands() []cli.Command
Commands returns the operations supported by this command
type Dev ¶
type Dev struct {
BaseCommand
}
Dev is the command for setting docker config to talk to a Docker Machine
type Doctor ¶
type Doctor struct {
BaseCommand
}
Doctor is the command for performing diagnostics on the Outrigger environment
type Kill ¶
type Kill struct {
BaseCommand
}
Kill is the command killing a Docker Machine
type Machine ¶
type Machine struct { Name string // contains filtered or unexported fields }
Machine is the struct for encapsulating operations on a Docker Machine
func (*Machine) CheckXhyveRequirements ¶
CheckXhyveRequirements verifies that the correct xhyve environment exists
func (*Machine) Create ¶
func (m *Machine) Create(driver string, cpuCount string, memSize string, diskSize string, isoURL string) error
Create will generate a new Docker Machine configured according to user specification
func (*Machine) GetBridgeIP ¶
GetBridgeIP returns the Bridge IP by looking for a bip= option
func (*Machine) GetData ¶
func (m *Machine) GetData() *simplejson.Json
GetData will inspect the Docker Machine and return the parsed JSON describing the machine
func (*Machine) GetDiskInGB ¶
GetDiskInGB returns the disk size in GB
func (*Machine) GetDockerVersion ¶
GetDockerVersion returns the Version of Docker running within Docker Machine
func (*Machine) GetHostDNSResolver ¶
GetHostDNSResolver checks if the VirtualBox host DNS resolver is working. This should work okay for VMware or other machines without the option, too.
func (*Machine) GetMemory ¶
GetMemory returns the amount of configured memory for this Docker Machine
func (*Machine) GetSysctl ¶
GetSysctl returns the configured value for the provided sysctl setting on the Docker Machine
func (*Machine) SetEnv ¶
func (m *Machine) SetEnv()
SetEnv will set the Docker proxy variables that determine which machine the docker command communicates
func (*Machine) UnsetEnv ¶
func (m *Machine) UnsetEnv()
UnsetEnv will remove the Docker proxy variables
func (*Machine) WaitForDev ¶
WaitForDev will wait a period of time for communication with the docker daemon to be established
type Project ¶
type Project struct { BaseCommand Config *ProjectConfig }
Project is the command enabling projects to define their own custom commands in a project based configuration file
func (*Project) GetScriptsAsSubcommands ¶
GetScriptsAsSubcommands Processes script configuration into formal subcommands.
func (*Project) ScriptRunHelp ¶
ScriptRunHelp generates help details based on script configuration.
type ProjectConfig ¶
type ProjectConfig struct { File string Path string Scripts map[string]*Script Sync *Sync Namespace string Version string Bin string }
ProjectConfig is the struct for the outrigger.yml file
func NewProjectConfig ¶
func NewProjectConfig() *ProjectConfig
NewProjectConfig creates a new ProjectConfig using configured or default locations
func NewProjectConfigFromFile ¶
func NewProjectConfigFromFile(filename string) (*ProjectConfig, error)
NewProjectConfigFromFile creates a new ProjectConfig from the specified file. @todo do not use the logger here, instead return errors. Use of the logger here initializes it in non-verbose mode. nolint: gocyclo
func (*ProjectConfig) NotEmpty ¶
func (c *ProjectConfig) NotEmpty() bool
NotEmpty is a simple check to confirm you have a populated config object.
func (*ProjectConfig) ValidateConfigVersion ¶
func (c *ProjectConfig) ValidateConfigVersion() error
ValidateConfigVersion ensures our configuration data structure conforms to our ad hoc schema. @TODO do this in a more formal way. See docker/libcompose for an example.
func (*ProjectConfig) ValidateProjectScripts ¶
func (c *ProjectConfig) ValidateProjectScripts(subcommands []cli.Command)
ValidateProjectScripts will validate the config scripts against a set of rules/norms nolint: gocyclo
type ProjectCreate ¶
type ProjectCreate struct {
BaseCommand
}
ProjectCreate is the command for running the project generator to scaffold a new project
func (*ProjectCreate) Commands ¶
func (cmd *ProjectCreate) Commands() []cli.Command
Commands returns the operations supported by this command
func (*ProjectCreate) Create ¶
func (cmd *ProjectCreate) Create(ctx *cli.Context) error
Create executes the `rig project create` command to execute the desired generator
func (*ProjectCreate) RunGenerator ¶
RunGenerator runs the generator image
type ProjectScript ¶
type ProjectScript struct {
// contains filtered or unexported fields
}
ProjectScript wraps the evaluation of project scripts. It mimics command struct except with unexported values.
func (*ProjectScript) Capture ¶
Capture matches Run, but returns the data from the command execution instead of "streaming" the result to the terminal.
func (*ProjectScript) CreateCommand ¶
func (p *ProjectScript) CreateCommand(steps, extra []string, workingDirectory string) *exec.Cmd
CreateCommand is a factory method to assemble an executable command from project-derived parameters. @see https://github.com/medhoover/gom/blob/staging/config/command.go
func (*ProjectScript) GetCommand ¶
func (p *ProjectScript) GetCommand(steps, extra []string, workingDirectory string) *exec.Cmd
GetCommand is a deprecation wrapper around NormalizeCommand. It was renamed for improved clarity alongside other methods.
func (*ProjectScript) GetWorkingDirectory ¶
func (p *ProjectScript) GetWorkingDirectory() string
GetWorkingDirectory retrieves the working directory for project commands.
func (*ProjectScript) Run ¶
func (p *ProjectScript) Run(script *Script, extra []string) int
Run takes a Script configuration and executes it per the definition of the project script and bonus arguments from the extra parameter. Commands are run from the directory context of the project if available. This also supports follow-up user interaction.
type ProjectSync ¶
type ProjectSync struct { BaseCommand Config *ProjectConfig }
ProjectSync is the command volume and file sync operations
func (*ProjectSync) Commands ¶
func (cmd *ProjectSync) Commands() []cli.Command
Commands returns the operations supported by this command
func (*ProjectSync) DeriveLocalSyncPath ¶
func (cmd *ProjectSync) DeriveLocalSyncPath(config *ProjectConfig, override string) (string, error)
DeriveLocalSyncPath will derive the source path for the local host side of the file sync. If there is no override, use an empty string.
func (*ProjectSync) GetVolumeName ¶
func (cmd *ProjectSync) GetVolumeName(config *ProjectConfig, workingDir string) string
GetVolumeName will find the volume name through a variety of fall backs
func (*ProjectSync) LoadComposeFile ¶
func (cmd *ProjectSync) LoadComposeFile() (*ComposeFile, error)
LoadComposeFile will load the proper compose file
func (*ProjectSync) LogFileName ¶
func (cmd *ProjectSync) LogFileName(name string) string
LogFileName gets the unison sync file name. Be sure to convert it to an absolute path if used with functions that cannot use the working directory context.
func (*ProjectSync) RunCheck ¶
func (cmd *ProjectSync) RunCheck(ctx *cli.Context) error
RunCheck performs a doctor-like examination of the file sync health.
func (*ProjectSync) RunName ¶
func (cmd *ProjectSync) RunName(ctx *cli.Context) error
RunName provides the name of the sync volume and container. This is made available to facilitate scripting.
func (*ProjectSync) RunPurge ¶
func (cmd *ProjectSync) RunPurge(ctx *cli.Context) error
RunPurge cleans out the project sync state.
func (*ProjectSync) RunStart ¶
func (cmd *ProjectSync) RunStart(ctx *cli.Context) error
RunStart executes the `rig project sync:start` command to start the Unison sync process.
func (*ProjectSync) RunStop ¶
func (cmd *ProjectSync) RunStop(ctx *cli.Context) error
RunStop executes the `rig project sync:stop` command to shut down and unison containers
func (*ProjectSync) SetupBindVolume ¶
func (cmd *ProjectSync) SetupBindVolume(volumeName string, workingDir string) error
SetupBindVolume will create minimal Docker Volumes for systems that have native container/volume support
func (*ProjectSync) StartUnisonSync ¶
func (cmd *ProjectSync) StartUnisonSync(ctx *cli.Context, volumeName string, config *ProjectConfig, workingDir string) error
StartUnisonSync will create and launch the volumes and containers on systems that need/support Unison
func (*ProjectSync) WaitForSyncInit ¶
func (cmd *ProjectSync) WaitForSyncInit(logFile string, workingDir string, timeoutSeconds int, syncWaitSeconds int) error
WaitForSyncInit will wait for the local unison process to finish initializing when the log file exists and has stopped growing in size
func (*ProjectSync) WaitForUnisonContainer ¶
func (cmd *ProjectSync) WaitForUnisonContainer(containerName string, timeoutSeconds int) (string, error)
WaitForUnisonContainer will wait for the unison container port to allow connections Due to the fact that we don't compile with -cgo (so we can build using Docker), we need to discover the IP address of the container instead of using the DNS name when compiled without -cgo this executable will not use the native mac dns resolution which is how we have configured dnsdock to provide names for containers.
type Prune ¶
type Prune struct {
BaseCommand
}
Prune is the command for cleaning up Docker resources
type Remove ¶
type Remove struct {
BaseCommand
}
Remove is the command for deleting a Docker Machine
type RigCommand ¶
RigCommand is the interface for all rig commands
type SSH ¶
type SSH struct {
BaseCommand
}
SSH is the command for staring an SSH session inside the docker machine vm
type Start ¶
type Start struct {
BaseCommand
}
Start is the command for creating and starting a Docker Machine and other core Outrigger services
func (*Start) StartMinimal ¶
StartMinimal will start "minimal" Outrigger operations, which refers to environments where a virtual machine and networking is not required or managed by Outrigger.
type Status ¶
type Status struct {
BaseCommand
}
Status is the command for reporting on the status of the Docker Machine
type Stop ¶
type Stop struct {
BaseCommand
}
Stop is the command for shutting down the Docker Machine and core Outrigger services
func (*Stop) StopMinimal ¶
StopMinimal will stop "minimal" Outrigger operations, which refers to environments where a virtual machine and networking are not required or managed by Outrigger.
func (*Stop) StopOutrigger ¶
StopOutrigger will halt all Outrigger and Docker-related operations.
type Upgrade ¶
type Upgrade struct {
BaseCommand
}
Upgrade is the command for backing up Docker Machine /data, upgrading the Docker Machine to the most recent release and restoring the Docker Machine /data