drone-ssh icon indicating copy to clipboard operation
drone-ssh copied to clipboard

Failed script reported as successfully executed

Open mschoettle opened this issue 5 years ago • 0 comments

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.

mschoettle avatar Dec 01 '20 15:12 mschoettle