contrib/run_resperf: handle exit correctly

parent 05cf8c8c
......@@ -3,10 +3,17 @@ set -o xtrace
JOBNAME=j$1.$2
exit_handler() {
exitcode=$?
docker-compose --no-ansi rm -fsv || :
echo "$exitcode" > ${JOBNAME}_exitcode
}
trap exit_handler EXIT
# HACK (condor): ensure files for transfer exist to avoid held jobs
touch ${JOBNAME}_kresd.docker.txt
touch ${JOBNAME}_resperf.txt
echo '0' > ${JOBNAME}_exitcode
echo '1' > ${JOBNAME}_exitcode # failed unless job exits with 0
mkdir logs
tar -czf ${JOBNAME}_logs.tar.gz -T /dev/null # empty tar by default
......@@ -26,17 +33,6 @@ fi
# Exit if any cmd fails from now on.
set -o errexit
cleanup() {
docker-compose --no-ansi rm -fsv || :
exit 0
}
trap cleanup EXIT
err_handle() {
echo '1' > ${JOBNAME}_exitcode
}
trap err_handle ERR
# Prepare ssh key for knot-resolver-security
set +o xtrace
SSH_PRIVATE_KEY=$(cat </home/respdiff/.ssh/knot_resolver_security.id_rsa || :)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment