Skip to content

Commit

Permalink
Keep running scripts when one fails (#895)
Browse files Browse the repository at this point in the history
Fixes #894
  • Loading branch information
marco-c committed Feb 18, 2020
1 parent eb9ec49 commit 7ce0eab
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion runauto_nag_common.sh
@@ -1,5 +1,4 @@
#!/bin/bash
set -e

PATH_SCRIPT="$( cd "$(dirname "$0")" ; pwd -P )"
cd "$PATH_SCRIPT"
Expand All @@ -13,3 +12,10 @@ if test ! -f auto_nag/scripts/configs/people.json; then
echo "Cannot run without the people.json file in auto_nag/scripts/configs/"
exit -1
fi

errored=false
ErrorHandler () {
errored=true
}

trap ErrorHandler ERR
5 changes: 4 additions & 1 deletion runauto_nag_daily.sh
@@ -1,5 +1,4 @@
#!/bin/bash
set -e

export PYTHONPATH=.

Expand Down Expand Up @@ -117,3 +116,7 @@ python -m auto_nag.scripts.stepstoreproduce
python -m auto_nag.scripts.spambug

deactivate

if [ "$errored" = true ] ; then
exit -1
fi
5 changes: 4 additions & 1 deletion runauto_nag_hourly.sh
@@ -1,5 +1,4 @@
#!/bin/bash
set -e

export PYTHONPATH=.

Expand Down Expand Up @@ -89,3 +88,7 @@ python -m auto_nag.scripts.prod_comp_changed_with_priority
python -m auto_nag.log --send

deactivate

if [ "$errored" = true ] ; then
exit -1
fi

0 comments on commit 7ce0eab

Please sign in to comment.