Create verify script for CI jobs 05/3005/1
authorZhe Huang <zhehuang@research.att.com>
Thu, 26 Mar 2020 20:50:33 +0000 (16:50 -0400)
committerZhe Huang <zhehuang@research.att.com>
Thu, 26 Mar 2020 20:50:36 +0000 (16:50 -0400)
Issue-ID: INT-109
Signed-off-by: Zhe Huang <zhehuang@research.att.com>
Change-Id: Ia2f7faa3e2b700965a2adbb00fc24d2bb5e25d1b

bin/verify-ric-charts

index 69fc49f..4452a09 100755 (executable)
 
 # Installs well-known RIC charts then verifies specified helm chart
 # Requires chart tgz archives in /tmp
-OVERRIDEYAML=$1
+HELMVER=$1
+OVERRIDEYAML=$2
 
 ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
 
+# Set up helm
+HELMVERSION=${HELMVER:=2.12.3}
+if [ ! -e helm-v${HELMVERSION}-linux-amd64.tar.gz ]; then
+  wget https://storage.googleapis.com/kubernetes-helm/helm-v${HELMVERSION}-linux-amd64.tar.gz
+fi
+
+tar -xvf ./helm-v${HELMVERSION}-linux-amd64.tar.gz
+mv linux-amd64/helm ./
+
+# set up ric common template
 ./setup-ric-common-template
 
+
+
+
 # Create array of helm charts
 CHART_ARRAY=()
 while IFS= read -r -d $'\0'; do
@@ -38,12 +52,12 @@ for dir in "${CHART_ARRAY[@]}"
 do
   
     echo "Update chart depenedency"
-    helm dep up $dir 
+    ./helm dep up $dir 
     # Lint clearly marks errors; e.g., [ERROR]
     if [ -z $OVERRIDEYAML ]; then
-        helm lint $dir > /tmp/output 2>&1
+        ./helm lint $dir > /tmp/output 2>&1
     else
-        helm lint -f $OVERRIDEYAML $dir> /tmp/output 2>&1
+        ./helm lint -f $OVERRIDEYAML $dir> /tmp/output 2>&1
     fi
     echo "***************************************************************************************************************"
     cat /tmp/output 
@@ -52,9 +66,9 @@ do
     echo "***************************************************************************************************************"
 
     if [ -z $OVERRIDEYAML ]; then
-        helm template $dir > /tmp/output 2>&1
+        ./helm template $dir > /tmp/output 2>&1
     else
-       helm template -f $OVERRIDEYAML $dir > /tmp/output 2>&1
+       ./helm template -f $OVERRIDEYAML $dir > /tmp/output 2>&1
     fi
     echo "***************************************************************************************************************"
     cat /tmp/output