custom actions: add env vars

action parameters can now be readed from env vars too.
Added a timeout for the command execution
This commit is contained in:
Nicola Murino
2020-01-09 12:00:37 +01:00
parent 37c602a477
commit eec60d6309
9 changed files with 169 additions and 73 deletions

View File

@@ -384,7 +384,14 @@ func (c *sshCommand) sendExitStatus(err error) {
metrics.SSHCommandCompleted(err)
// for scp we notify single uploads/downloads
if err == nil && c.command != "scp" {
go executeAction(operationSSHCmd, c.connection.User.Username, c.getDestPath(), "", c.command)
realPath := c.getDestPath()
if len(realPath) > 0 {
p, err := c.connection.buildPath(realPath)
if err == nil {
realPath = p
}
}
go executeAction(operationSSHCmd, c.connection.User.Username, realPath, "", c.command, 0)
}
}