deploy

package
v0.0.0-...-71876dc Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATUS_INIT   = 0
	STATUS_ING    = 1
	STATUS_DONE   = 2
	STATUS_FAILED = 3
)
View Source
const (
	DEPLOY_PARALLEL = 1
	DEPLOY_SERIAL   = 2
)
View Source
const (
	COMMAND_TIMEOUT = 3600
)

Variables

This section is empty.

Functions

func ExistsTask

func ExistsTask(id int) bool

func NewServer

func NewServer(srv *Server)

func NewTask

func NewTask(id, mode int, deploys []*Deploy, startFn, finishFn CallbackFn, taskFn TaskCallbackFn) error

func StopTask

func StopTask(id int)

Types

type CallbackFn

type CallbackFn func(int, int, int, []*ServerResult)

type Deploy

type Deploy struct {
	ID            int
	User          string
	PreCmd        string
	PostCmd       string
	DeployPath    string
	DeployTmpPath string
	PackFile      string
	// contains filtered or unexported fields
}

func (*Deploy) AddServer

func (d *Deploy) AddServer(id int, addr string, port int)

func (*Deploy) Parallel

func (d *Deploy) Parallel()

func (*Deploy) Result

func (d *Deploy) Result() ([]*ServerResult, int)

func (*Deploy) Serial

func (d *Deploy) Serial()

func (*Deploy) Terminate

func (d *Deploy) Terminate()

type DeployResult

type DeployResult struct {
	ID         int
	Status     int
	ServerRest []*ServerResult
}

func StatusTask

func StatusTask(id int) []*DeployResult

type Server

type Server struct {
	ID            int
	Addr          string
	User          string
	Port          int
	PreCmd        string
	PostCmd       string
	Key           string
	PackFile      string
	DeployTmpPath string
	DeployPath    string
	// contains filtered or unexported fields
}

func (*Server) Deploy

func (srv *Server) Deploy()

func (*Server) Result

func (srv *Server) Result() *ServerResult

func (*Server) Terminate

func (srv *Server) Terminate()

type ServerResult

type ServerResult struct {
	ID         int
	TaskResult []*command.TaskResult
	Status     int
	Error      error
}

type TaskCallbackFn

type TaskCallbackFn func(int, int)

Jump to

Keyboard shortcuts

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