[CORD-3050]v2
Update helmlint.sh to match Jenkins
Have candidate-tag-values.yaml set imagePullPolicy to IfNotPresent

Change-Id: I5eecef41f28d528ab0c0499a977695b4c7207932
diff --git a/scripts/helmlint.sh b/scripts/helmlint.sh
index 0fe48c0..27cf676 100755
--- a/scripts/helmlint.sh
+++ b/scripts/helmlint.sh
@@ -17,17 +17,24 @@
 # helmlint.sh
 # run `helm lint` on all helm charts that are found
 
-set +e
+set +e -u -o pipefail
+
+# verify that we have helm installed
+command -v helm >/dev/null 2>&1 || { echo "helm not found, please install it" >&2; exit 1; }
+
 echo "helmlint.sh, using helm version: $(helm version -c --short)"
 
 fail_lint=0
 
-for chart in $(find . -name Chart.yaml -print) ; do
+# when not running under Jenkins, use current dir as workspace
+WORKSPACE=${WORKSPACE:-.}
+
+for chart in $(find "${WORKSPACE}" -name Chart.yaml -print) ; do
 
   chartdir=$(dirname "${chart}")
 
   # update requirements if it exists. Skip voltha as it has non-clean reqirements
-  if [ "${chartdir}" != "./voltha" ] && [ -f "${chartdir}/requirements.yaml" ]; then
+  if [[ ! $chartdir =~ voltha$ ]] && [ -f "${chartdir}/requirements.yaml" ]; then
     helm dependency update "${chartdir}"
   fi