mirror of
https://github.com/appleboy/drone-ssh.git
synced 2026-06-14 05:12:39 +08:00
feat: Support proxy command. (#55)
This commit is contained in:
@@ -19,6 +19,16 @@ const (
|
||||
)
|
||||
|
||||
type (
|
||||
defaultConfig struct {
|
||||
User string
|
||||
Server string
|
||||
Key string
|
||||
KeyPath string
|
||||
Port string
|
||||
Password string
|
||||
Timeout time.Duration
|
||||
}
|
||||
|
||||
// Config for the plugin.
|
||||
Config struct {
|
||||
Key string
|
||||
@@ -30,6 +40,7 @@ type (
|
||||
Timeout time.Duration
|
||||
CommandTimeout int
|
||||
Script []string
|
||||
Proxy defaultConfig
|
||||
}
|
||||
|
||||
// Plugin structure
|
||||
@@ -66,6 +77,15 @@ func (p Plugin) Exec() error {
|
||||
Key: p.Config.Key,
|
||||
KeyPath: p.Config.KeyPath,
|
||||
Timeout: p.Config.Timeout,
|
||||
Proxy: defaultConfig{
|
||||
Server: p.Config.Proxy.Server,
|
||||
User: p.Config.Proxy.User,
|
||||
Password: p.Config.Proxy.Password,
|
||||
Port: p.Config.Proxy.Port,
|
||||
Key: p.Config.Proxy.Key,
|
||||
KeyPath: p.Config.Proxy.KeyPath,
|
||||
Timeout: p.Config.Proxy.Timeout,
|
||||
},
|
||||
}
|
||||
|
||||
p.log(host, "commands: ", strings.Join(p.Config.Script, "\n"))
|
||||
|
||||
Reference in New Issue
Block a user