Documentation
¶
Index ¶
- func AppendCommandEnvsToTask(cmd *entity.Command, task *entity.Task)
- func CheckInitialArgs(network *entity.Network, initialArgs *entity.InitialArgs)
- func CreateTasks(cmd *entity.Command, clients []entity.ClientFacade, env entity.EnvList, ...) ([]*entity.Task, error)
- func EnsureLocalhost(supFile *entity.Supfile)
- func GenerateSUPENVFrom(vars *entity.EnvList)
- func LocalTarCmdArgs(path, exclude string) []string
- func MergeVars(conf *entity.Supfile, network *entity.Network) entity.EnvList
- func NewSupfile(data []byte) (*entity.Supfile, error)
- func NewTarStreamReader(cwd, path, exclude string) (io.Reader, error)
- func ParseInitialArgs(initData entity.InitState) (*entity.PlayBook, error)
- func ReadSupfile(initialArgs *entity.InitialArgs) *entity.Supfile
- func RemoteTarCommand(dir string) string
- func ResolveLocalPath(cwd, path, env string) (string, error)
- func ResolvePath(path string) string
- func ResolveValues(e *entity.EnvList) error
- func RunShellcheck(supFile *entity.Supfile) error
- func SetEnvValues(vars *entity.EnvList, initialArgs *entity.InitialArgs)
- func TargetsHaveAffixes(conf *entity.Supfile) bool
- type ShellCheck
- type Stackup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckInitialArgs ¶
func CheckInitialArgs(network *entity.Network, initialArgs *entity.InitialArgs)
func CreateTasks ¶
func EnsureLocalhost ¶
func GenerateSUPENVFrom ¶
GenerateSUPENVFrom generates the SUP_ENV environment variable from the environment variables in the vars list
func LocalTarCmdArgs ¶
func MergeVars ¶
MergeVars merges two entity.EnvList lists, one from supfile and one from network, resolves the values of the environment variables with shell substitution, and returns the merged list of environment variables
func NewSupfile ¶
NewSupfile parses configuration file and returns Supfile or error.
func NewTarStreamReader ¶
NewTarStreamReader creates a tar stream reader from a local path. TODO: Refactor. Use "archive/tar" instead.
func ParseInitialArgs ¶
ParseInitialArgs parses args and returns network and commands to be run. On error, it prints usage and exits.
func ReadSupfile ¶
func ReadSupfile(initialArgs *entity.InitialArgs) *entity.Supfile
ReadSupfile looks for Supfile or Supfiley.yml in the current working directory, cd's to Supfile dir, reads it and calls NewSupfile, after all returns the parsed Supfile.
func RemoteTarCommand ¶
RemoteTarCommand returns command to be run on remote SSH host to properly receive the created TAR stream. TODO: Check for relative directory.
func ResolveLocalPath ¶
ResolveLocalPath - Use bash to resolve $ENV_VARs. like: `~/dir` or `$HOME/dir`
func ResolvePath ¶
ResolvePath resolves a path relative to the current working directory
func ResolveValues ¶
func RunShellcheck ¶
func SetEnvValues ¶
func SetEnvValues(vars *entity.EnvList, initialArgs *entity.InitialArgs)
SetEnvValues sets vars from env pairs inside the initialArgs.EnvVars, values there will be given as 'key=value'
func TargetsHaveAffixes ¶
Types ¶
type Stackup ¶
type Stackup struct { Args *entity.InitialArgs // contains filtered or unexported fields }
func NewStackup ¶
NewStackup creates a new Stackup instance.
func (*Stackup) Run ¶
func (sup *Stackup) Run(network *entity.Network, envVars entity.EnvList, commands ...*entity.Command) error
Run runs set of commands on multiple hosts defined by network sequentially.
TODO: This megamoth method needs a big refactor and should be split to multiple smaller methods.