ops

package
v0.0.0-...-1225e6c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExecutor

func NewExecutor(conf *Opsfile, debug bool, dryRun bool) *cliExecutor

Types

type ConnectError

type ConnectError struct {
	Host string
	Err  error
}

func (*ConnectError) Error

func (ce *ConnectError) Error() string

type Environments

type Environments struct {
	Envs map[string]string
}

func (*Environments) UnmarshalYAML

func (e *Environments) UnmarshalYAML(node *yaml.Node) error

type Ops

type Ops struct {
	// contains filtered or unexported fields
}

func NewOps

func NewOps(conf *Opsfile, options ...OpsOption) *Ops

func (*Ops) Run

func (ops *Ops) Run(serverTag string, tasks ...string) error

Run

type OpsOption

type OpsOption func(*Ops)

func WithDebug

func WithDebug(debug bool) OpsOption

func WithDryRun

func WithDryRun(dryRun bool) OpsOption

type Opsfile

type Opsfile struct {
	Shell        string        `yaml:"shell"`
	FailFast     bool          `yaml:"fail-fast"`
	Servers      *Servers      `yaml:"servers"`
	Tasks        *Tasks        `yaml:"tasks"`
	Environments *Environments `yaml:"environments"`
}

func NewOpsfile

func NewOpsfile(data []byte) (*Opsfile, error)

func NewOpsfileFromPath

func NewOpsfileFromPath(path string) (*Opsfile, error)

type ParseError

type ParseError struct {
	Err error
	// contains filtered or unexported fields
}

func (*ParseError) Error

func (pe *ParseError) Error() string

type Preparer

type Preparer interface {
	Prepare(*Opsfile)
}

type RunError

type RunError struct {
	// contains filtered or unexported fields
}

func (*RunError) Error

func (te *RunError) Error() string

type Server

type Server struct {
	Host     string   `yaml:"host"`
	Port     uint     `yaml:"port"`
	User     string   `yaml:"user"`
	Password string   `yaml:"password"`
	Tags     []string `yaml:"tags"`
}

type Servers

type Servers struct {
	Names map[string]*Server
}

func (*Servers) UnmarshalYAML

func (c *Servers) UnmarshalYAML(node *yaml.Node) error

type Task

type Task struct {
	Name     string            `yaml:"name"`
	Cmd      string            `yaml:"command"`
	Transfer string            `yaml:"transfer"`
	Desc     string            `yaml:"desc"`
	Local    bool              `yaml:"local"`
	Envs     map[string]string `yaml:"environments"`
	Deps     []string          `yaml:"dependencies"`
}

type Tasks

type Tasks struct {
	Names map[string]*Task
}

func (*Tasks) UnmarshalYAML

func (t *Tasks) UnmarshalYAML(node *yaml.Node) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL