X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fjjb-cleanup.sh;h=ffdfe1f4601bdc6f988117dc493e0d88ac1a14a3;hb=2a10c83b2d506008cc6c01c134515fb6328e1f3a;hp=9f3536a3c406d96e3d35ba003c9cdbd797fa8458;hpb=9b240453b91f3c4b0844ea1c593721a1c421caa2;p=releng%2Fglobal-jjb.git diff --git a/shell/jjb-cleanup.sh b/shell/jjb-cleanup.sh index 9f3536a3..ffdfe1f4 100644 --- a/shell/jjb-cleanup.sh +++ b/shell/jjb-cleanup.sh @@ -15,12 +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" && echo "$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