mirror of
https://github.com/OliveTin/OliveTin
synced 2025-12-12 00:55:34 +00:00
feature: Better feedback on shellAfterCommand, and mark OliveTin specific output with "OliveTin::" in logs (#403)
This commit is contained in:
@@ -491,7 +491,7 @@ func stepExec(req *ExecutionRequest) bool {
|
|||||||
// The context timeout should kill the process, but let's make sure.
|
// The context timeout should kill the process, but let's make sure.
|
||||||
req.executor.Kill(req.logEntry)
|
req.executor.Kill(req.logEntry)
|
||||||
req.logEntry.TimedOut = true
|
req.logEntry.TimedOut = true
|
||||||
req.logEntry.Output += "This OliveTin action timed out after " + fmt.Sprintf("%v", req.Action.Timeout) + " seconds. If you need more time for this action, set a longer timeout. See https://docs.olivetin.app/timeout.html for more help."
|
req.logEntry.Output += "OliveTin::timeout - this action timed out after " + fmt.Sprintf("%v", req.Action.Timeout) + " seconds. If you need more time for this action, set a longer timeout. See https://docs.olivetin.app/timeout.html for more help."
|
||||||
}
|
}
|
||||||
|
|
||||||
req.logEntry.DatetimeFinished = time.Now()
|
req.logEntry.DatetimeFinished = time.Now()
|
||||||
@@ -525,17 +525,24 @@ func stepExecAfter(req *ExecutionRequest) bool {
|
|||||||
|
|
||||||
waiterr := cmd.Wait()
|
waiterr := cmd.Wait()
|
||||||
|
|
||||||
req.logEntry.Output += "---\n" + stdout.String()
|
req.logEntry.Output += "\n" + stdout.String()
|
||||||
req.logEntry.Output += "---\n" + stderr.String()
|
req.logEntry.Output += "OliveTin::shellAfterCompleted stdout\n" + stdout.String()
|
||||||
|
req.logEntry.Output += stdout.String()
|
||||||
|
|
||||||
|
req.logEntry.Output += "OliveTin::shellAfterCompleted stderr\n" + stdout.String()
|
||||||
|
req.logEntry.Output += stderr.String()
|
||||||
|
|
||||||
|
req.logEntry.Output += "OliveTin::shellAfterCompleted errors and summary\n" + stdout.String()
|
||||||
appendErrorToStderr(runerr, req.logEntry)
|
appendErrorToStderr(runerr, req.logEntry)
|
||||||
appendErrorToStderr(waiterr, req.logEntry)
|
appendErrorToStderr(waiterr, req.logEntry)
|
||||||
|
|
||||||
if ctx.Err() == context.DeadlineExceeded {
|
if ctx.Err() == context.DeadlineExceeded {
|
||||||
req.logEntry.Output += "Your shellAfterCommand command timed out."
|
req.logEntry.Output += "Your shellAfterCompleted command timed out."
|
||||||
}
|
}
|
||||||
|
|
||||||
req.logEntry.Output += fmt.Sprintf("Your shellAfterCommand exited with code %v", cmd.ProcessState.ExitCode())
|
req.logEntry.Output += fmt.Sprintf("Your shellAfterCompleted exited with code %v\n", cmd.ProcessState.ExitCode())
|
||||||
|
|
||||||
|
req.logEntry.Output += "OliveTin::shellAfterCompleted output complete\n" + stdout.String()
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user