Update a1 mediator image and helm installation
[ric-plt/ric-dep.git] / bin / verify-ric-charts
index 6cadf7c..fdeda1b 100755 (executable)
@@ -28,19 +28,19 @@ echo "--> verify-ric-charts"
 if [[ "${1:-nope}" != "nope" ]]; then
     HELMVERSION=$1
 else
-    HELMVERSION=2.12.3
+    HELMVERSION=2.17.0
 fi
 if [[ "${2:-nope}" != "nope" ]]; then
     OVERRIDEYAML=$2
 fi
 
-ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+ROOT_DIR="$(pwd)"
 HELM_COMMAND=helm
 
 if ! $($HELM_COMMAND > /dev/null);then
     echo "Download and install Helm"
     if [ ! -e helm-v${HELMVERSION}-linux-amd64.tar.gz ]; then
-      wget -nv https://storage.googleapis.com/kubernetes-helm/helm-v${HELMVERSION}-linux-amd64.tar.gz
+      wget -nv https://get.helm.sh/helm-v${HELMVERSION}-linux-amd64.tar.gz
     fi
     tar -xvf ./helm-v${HELMVERSION}-linux-amd64.tar.gz
     mv linux-amd64/helm ./
@@ -52,10 +52,9 @@ fi
 git clone --single-branch --branch master "https://gerrit.o-ran-sc.org/r/it/dep" ./dep
 
 # Start Helm local repo if there isn't one
-HELM_PID=$(pgrep  "$HELM_COMMAND")
-if [ ! -z "$HELM_PID" ]; then
+if [ ! -z $(pgrep "$HELM_COMMAND") ]; then
     echo "Stopping existing local Helm server."
-    kill -9 "$HELM_PID"
+    kill -9 "$(pgrep "$HELM_COMMAND")"
 fi
 if [ ! -d ./charts ]; then
     mkdir ./charts
@@ -68,6 +67,7 @@ $HELM_COMMAND package --save=false -d ./charts "$ROOT_DIR/dep/ric-common/Common-
 $HELM_COMMAND repo index ./charts
 # Make sure that helm local repo is added
 $HELM_COMMAND repo remove local
+$HELM_COMMAND repo remove stable
 $HELM_COMMAND repo add local http://127.0.0.1:8879/charts
 # Remove it/dep charts
 rm -rf ./dep
@@ -88,24 +88,18 @@ do
     # Lint clearly marks errors; e.g., [ERROR]
     echo "Performing Helm lint"
     if [[ "${OVERRIDEYAML:-nope}" != "nope" ]]; then
-        $HELM_COMMAND lint -f "$OVERRIDEYAML" "$dir"> /tmp/output 2>&1
+        $HELM_COMMAND lint -f "$OVERRIDEYAML" "$dir"
     else
-        $HELM_COMMAND lint "$dir" > /tmp/output 2>&1
+        $HELM_COMMAND lint "$dir" 
     fi
     echo "***************************************************************************************************************"
-    cat /tmp/output 
-    egrep -q '^Error: [0-9]* chart\(s\) linted, [0-9]* chart\(s\) failed' /tmp/output && exit 1
-    echo "***************************************************************************************************************"
     echo "Rendering Helm charts locally"
     if [[ "${OVERRIDEYAML:-nope}" != "nope" ]]; then
-       $HELM_COMMAND template -f "$OVERRIDEYAML" "$dir" > /tmp/output 2>&1
+       $HELM_COMMAND template -f "$OVERRIDEYAML" "$dir"
     else
-        $HELM_COMMAND template "$dir" > /tmp/output 2>&1
+        $HELM_COMMAND template "$dir"
     fi
     echo "***************************************************************************************************************"
-    cat /tmp/output 
-    grep -E -n '%!.\(.*=.*\)' /tmp/output && echo "Error: Type mismatch." && exit 1
-    echo "***************************************************************************************************************"
 done
 echo "--> verify-ric-charts ends"
 exit 0