drone-ssh
drone-ssh copied to clipboard
Failed script reported as successfully executed
I use drone-ssh to execute a shell script on a server.
This script has an abort trap and in that case exits with the error code:
#!/bin/bash
set -eu
abort() {
echo "an error occurred. exiting..."
exit $?
}
trap 'abort' ERR
# do something
However, in the case an error occurs it is still being reported as "Successfully executed commands to all host.". In this particular case it was a git command that failed, not sure if this makes a difference. I assume that the exit code != 0 so I would expect that this is detected as an error.
In the settings I have script_stop: true.