mirror of
https://github.com/appleboy/drone-ssh.git
synced 2025-07-02 21:52:51 +08:00
chore: add single command for github actions.
This commit is contained in:
parent
530cb1df6e
commit
9ef0a47bc0
13
main.go
13
main.go
@ -85,7 +85,12 @@ func main() {
|
|||||||
cli.StringSliceFlag{
|
cli.StringSliceFlag{
|
||||||
Name: "script,s",
|
Name: "script,s",
|
||||||
Usage: "execute commands",
|
Usage: "execute commands",
|
||||||
EnvVar: "PLUGIN_SCRIPT,SSH_SCRIPT,SCRIPT,INPUT_SCRIPT",
|
EnvVar: "PLUGIN_SCRIPT,SSH_SCRIPT,SCRIPT",
|
||||||
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "script.string",
|
||||||
|
Usage: "execute single commands for github action",
|
||||||
|
EnvVar: "INPUT_SCRIPT",
|
||||||
},
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "script.stop",
|
Name: "script.stop",
|
||||||
@ -180,6 +185,10 @@ REPOSITORY:
|
|||||||
}
|
}
|
||||||
|
|
||||||
func run(c *cli.Context) error {
|
func run(c *cli.Context) error {
|
||||||
|
scripts := c.StringSlice("script")
|
||||||
|
if s := c.String("script.string"); s != "" {
|
||||||
|
scripts = append(scripts, s)
|
||||||
|
}
|
||||||
plugin := Plugin{
|
plugin := Plugin{
|
||||||
Config: Config{
|
Config: Config{
|
||||||
Key: c.String("ssh-key"),
|
Key: c.String("ssh-key"),
|
||||||
@ -190,7 +199,7 @@ func run(c *cli.Context) error {
|
|||||||
Port: c.Int("port"),
|
Port: c.Int("port"),
|
||||||
Timeout: c.Duration("timeout"),
|
Timeout: c.Duration("timeout"),
|
||||||
CommandTimeout: c.Duration("command.timeout"),
|
CommandTimeout: c.Duration("command.timeout"),
|
||||||
Script: c.StringSlice("script"),
|
Script: scripts,
|
||||||
ScriptStop: c.Bool("script.stop"),
|
ScriptStop: c.Bool("script.stop"),
|
||||||
Envs: c.StringSlice("envs"),
|
Envs: c.StringSlice("envs"),
|
||||||
Debug: c.Bool("debug"),
|
Debug: c.Bool("debug"),
|
||||||
|
Loading…
Reference in New Issue
Block a user