Fix rtd merge job to handle new tag uploaded
[releng/global-jjb.git] / shell / jjb-cleanup.sh
index 9f3536a..ffdfe1f 100644 (file)
@@ -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