X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fjjb-cleanup.sh;h=ffdfe1f4601bdc6f988117dc493e0d88ac1a14a3;hb=e1a8dc64cfe10360ebdcadd28806adf800760ce7;hp=8f5a62607a44a7d466bdf8c136e5e67a1d8147b2;hpb=1c748f633fba763bdb98cdc337f29b35b8b81e5e;p=releng%2Fglobal-jjb.git diff --git a/shell/jjb-cleanup.sh b/shell/jjb-cleanup.sh index 8f5a6260..ffdfe1f4 100644 --- a/shell/jjb-cleanup.sh +++ b/shell/jjb-cleanup.sh @@ -15,11 +15,13 @@ echo "---> jjb-cleanup.sh" # Ensure we fail the job if any steps fail. # DO NOT set -u as virtualenv's activate script has unbound variables -set -e -o pipefail +set -e +u -o pipefail # shellcheck source="$WORKSPACE/.jjb.properties" disable=SC1091 source "$WORKSPACE/.jjb.properties" if [[ -n "$JJB_VENV" && "$JJB_VENV" =~ /tmp/.* ]]; then - rm -r "$JJB_VENV" && "$JJB_VENV removed" + rm -rf "$JJB_VENV" && echo "$JJB_VENV removed" + unset JJB_VENV fi -rm "$WORKSPACE/.jjb.properties" +rm -f "$WORKSPACE/.jjb.properties" +deactivate