Documentation
¶
Index ¶
- type AffixMappig
- type Command
- type Commands
- type DownloadOrder
- type EnvList
- func (e *EnvList) AsExport() string
- func (e EnvList) Get(key string) string
- func (e EnvList) GetStore() map[string]string
- func (e EnvList) Keys() []string
- func (e *EnvList) RemoveEnvVarByKey(key string) bool
- func (e *EnvList) Set(key, value string)
- func (e EnvList) Slice() []string
- func (e *EnvList) String() string
- func (e *EnvList) UnmarshalYAML(unmarshal func(interface{}) error) error
- type EnvVar
- type ErrMustUpdate
- type ErrUnsupportedSupfileVersion
- type Network
- type NetworkHost
- type Networks
- type Supfile
- type Targets
- type UploadOrder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AffixMappig ¶
type Command ¶
type Command struct {
Name string `yaml:"-"` // Command name.
Desc string `yaml:"desc"` // Command description.
Local string `yaml:"local"` // Command(s) to be run locally.
Run string `yaml:"run"` // Command(s) to be run remotelly.
Script string `yaml:"script"` // Load command(s) from script and run it remotelly.
Upload []*UploadOrder `yaml:"upload","up"` // See Upload struct.
Stdin bool `yaml:"stdin"` // Attach localhost STDOUT to remote commands' STDIN?
Once bool `yaml:"once"` // The command should be run "once" (on one host only).
Serial int `yaml:"serial"` // Max number of clients processing a task in parallel.
Fetch []*DownloadOrder `yaml:"fetch","download","dl"` // See Fetch struct.
Sudo bool `yaml:"sudo" ` // Run command(s) as root?
SudoPass string `yaml:"sudo_pass"`
Env EnvList `yaml:"env"`
Dist string `yaml:"dist"`
// API backward compatibility. Will be deprecated in v1.0.
RunOnce bool `yaml:"run_once"` // The command should be run once only.
}
Command represents command(s) to be run remotely.
type DownloadOrder ¶
type EnvList ¶
type EnvList struct {
// contains filtered or unexported fields
}
EnvList is a list of environment variables that maps to a YAML map, but maintains order, enabling late variables to reference early variables.
func (*EnvList) RemoveEnvVarByKey ¶
RemoveEnvVarByKey removes an EnvVar from EnvList by key. It returns true if the variable was found and removed, or false otherwise.
func (*EnvList) UnmarshalYAML ¶
type EnvVar ¶
EnvVar represents an environment variable
type ErrMustUpdate ¶
type ErrMustUpdate struct {
Msg string
}
func (ErrMustUpdate) Error ¶
func (e ErrMustUpdate) Error() string
type ErrUnsupportedSupfileVersion ¶
type ErrUnsupportedSupfileVersion struct {
Msg string
}
func (ErrUnsupportedSupfileVersion) Error ¶
func (e ErrUnsupportedSupfileVersion) Error() string
type Network ¶
type Network struct {
Env EnvList `yaml:"env"`
Inventory string `yaml:"inventory"`
Hosts []NetworkHost `yaml:"hosts"`
Bastion string `yaml:"bastion"` // Jump host for the environment
// Should these live on Hosts too? We'd have to change []string to struct, even in Supfile.
User string `yaml:"user"`
Password string `yaml:"pass" `
IdentityFile string `yaml:"id_file"`
Name string
}
Network is group of hosts with extra custom env vars.
func (Network) ParseInventory ¶
func (n Network) ParseInventory() ([]NetworkHost, error)
ParseInventory runs the inventory command, if provided, and appends the command's output lines to the manually defined list of hosts.
func (*Network) UnmarshalYAML ¶
type NetworkHost ¶
type NetworkHost struct {
Host string `yaml:"host"`
User string `yaml:"user"`
Password string `yaml:"pass"`
Tube string `yaml:"tube"`
Env EnvList `yaml:"env"`
Sudo bool `yaml:"sudo" default:"false"`
}
func (*NetworkHost) String ¶
func (n *NetworkHost) String() string
func (*NetworkHost) UnmarshalYAML ¶
func (n *NetworkHost) UnmarshalYAML(unmarshal func(interface{}) error) error
type Networks ¶
Networks is a list of user-defined networks
func (*Networks) Set ¶
this is just to set localhost so we dont process slice of values as we should be...
func (*Networks) UnmarshalYAML ¶
type Supfile ¶
type Supfile struct {
Networks Networks `yaml:"networks"`
Commands Commands `yaml:"commands"`
Targets Targets `yaml:"targets"`
Env EnvList `yaml:"env"`
Version string `yaml:"version"`
Desc string `yaml:"desc"`
}
Supfile represents the Stack Up configuration YAML file.
type Targets ¶
type Targets struct {
Names []string
// contains filtered or unexported fields
}
Targets is a list of user-defined targets by default affixed are mapped by command name
func (*Targets) GetAffixByCommandName ¶
func (t *Targets) GetAffixByCommandName(name string) (AffixMappig, bool)
func (*Targets) HasAffixes ¶
func (*Targets) UnmarshalYAML ¶
type UploadOrder ¶
type UploadOrder struct {
Src string `yaml:"src"`
Dst string `yaml:"dst"`
Exc string `yaml:"exclude"`
}
UploadOrder represents file copy operation from localhost Src path to Dst path of every host in a given Network.
func (*UploadOrder) UnmarshalYAML ¶
func (u *UploadOrder) UnmarshalYAML(unmarshal func(interface{}) error) error