Add sync mode. (#101)

* Add sync mode.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* close channel in sync mode.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* close channel in sync mode.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2017-10-29 21:31:51 -05:00
committed by GitHub
parent 2d5668ff17
commit 7220c94832
3 changed files with 103 additions and 73 deletions
+6
View File
@@ -66,6 +66,11 @@ func main() {
EnvVar: "PLUGIN_PORT,SSH_PORT",
Value: 22,
},
cli.BoolFlag{
Name: "sync",
Usage: "sync mode",
EnvVar: "PLUGIN_SYNC",
},
cli.DurationFlag{
Name: "timeout,t",
Usage: "connection timeout",
@@ -195,6 +200,7 @@ func run(c *cli.Context) error {
Secrets: c.StringSlice("secrets"),
Envs: c.StringSlice("envs"),
Debug: c.Bool("debug"),
Sync: c.Bool("sync"),
Proxy: easyssh.DefaultConfig{
Key: c.String("proxy.ssh-key"),
KeyPath: c.String("proxy.key-path"),