Documentation
¶
Overview ¶
Package easydeploy makes your deployment easy
Index ¶
- type Command
- type Deploy
- type DeployReport
- type Deployer
- func (sc *Deployer) Local(cmd string, args ...interface{})
- func (sc *Deployer) MaxConcurrency(num int)
- func (sc *Deployer) OnceBeforeDeploy(fn func() error)
- func (sc *Deployer) OnceDoneDeploy(fn func(bool) error)
- func (sc *Deployer) RegisterDeployServer(srvConf *ServerConfig)
- func (sc *Deployer) Remote(cmd string, args ...interface{})
- func (sc *Deployer) Start() []*DeployReport
- func (sc *Deployer) Upload(localPath, remotePath string)
- func (sc *Deployer) Verbose()
- type LocalCommand
- type RemoteCommand
- type ServerConfig
- type UploadCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface {
Run(deployCtx Deploy, srvConf *ServerConfig) error
}
type Deploy ¶
type Deploy interface {
RegisterDeployServer(srvConf *ServerConfig)
OnceBeforeDeploy(fn func() error)
OnceDoneDeploy(fn func(bool) error)
Local(cmd string, args ...interface{})
Remote(cmd string, args ...interface{})
Upload(localPath, remotePath string)
MaxConcurrency(num int)
Start() []*DeployReport
Verbose()
// contains filtered or unexported methods
}
type DeployReport ¶
type DeployReport struct {
SrvConf *ServerConfig
Start time.Time
Consumed int64
CmdRuns int
Cmds int
// contains filtered or unexported fields
}
func (*DeployReport) String ¶
func (rp *DeployReport) String() string
type Deployer ¶
type Deployer struct {
SrvConf []*ServerConfig
// contains filtered or unexported fields
}
func (*Deployer) MaxConcurrency ¶
MaxConcurrency controls how many deployments will run simultaneously if you deploy to multiple servers. 0 means all deployments will start asynchronously.
func (*Deployer) OnceBeforeDeploy ¶
OnceBeforeDeploy called only once before deployment
func (*Deployer) OnceDoneDeploy ¶
OnceDoneDeploy called only once when deployment is done even if deployment failed
func (*Deployer) RegisterDeployServer ¶
func (sc *Deployer) RegisterDeployServer(srvConf *ServerConfig)
Local register a command to be run on localhost
func (*Deployer) Start ¶
func (sc *Deployer) Start() []*DeployReport
Start will start the deploy process
type LocalCommand ¶
type LocalCommand struct {
CmdStr string
}
func (*LocalCommand) Run ¶
func (localCmd *LocalCommand) Run(deployCtx Deploy, srvConf *ServerConfig) error
type RemoteCommand ¶
type RemoteCommand struct {
CmdStr string
}
func (*RemoteCommand) Run ¶
func (remoteCmd *RemoteCommand) Run(deployCtx Deploy, srvConf *ServerConfig) error
type ServerConfig ¶
readonly
func NewSrvConf ¶
func NewSrvConf(format string) *ServerConfig
NewSrvConf parse server config from string with format: user@host:port/password
func (*ServerConfig) MakeSSHConfig ¶
func (sc *ServerConfig) MakeSSHConfig() *easyssh.SSHConfig
func (*ServerConfig) Simple ¶
func (sc *ServerConfig) Simple() string
func (*ServerConfig) String ¶
func (sc *ServerConfig) String() string
type UploadCommand ¶
func (*UploadCommand) Run ¶
func (uploadCmd *UploadCommand) Run(deployCtx Deploy, srvConf *ServerConfig) error
Click to show internal directories.
Click to hide internal directories.