Updates and fixes for scripts, add wait_for_jobs.sh script

Change-Id: I28ce250cf9ad499af0b23e4544dcb0ee13762a1e
diff --git a/scripts/helmrepo.sh b/scripts/helmrepo.sh
index ca96974..0405e55 100755
--- a/scripts/helmrepo.sh
+++ b/scripts/helmrepo.sh
@@ -17,7 +17,10 @@
 # helmrepo.sh
 # creates a helm repo for publishing on guide website
 
-set -e -u -o pipefail
+set -eu -o pipefail
+
+# when not running under Jenkins, use current dir as workspace
+WORKSPACE=${WORKSPACE:-.}
 
 REPO_DIR="${REPO_DIR:-chart_repo}"
 
@@ -26,15 +29,15 @@
 
 mkdir -p "${REPO_DIR}"
 
-for chart in $(find . -name Chart.yaml -print) ; do
-
+while IFS= read -r -d '' chart
+do
   chartdir=$(dirname "${chart}")
 
   echo "Adding ${chartdir}"
 
   helm package --dependency-update --destination "${REPO_DIR}" "${chartdir}"
 
-done
+done < <(find "${WORKSPACE}" -name Chart.yaml -print0)
 
 echo "Generating repo index"