From dbdd2b560f7d1f5eb2d369a4ae6a5c564285b38c Mon Sep 17 00:00:00 2001 From: Zhe Huang Date: Thu, 26 Mar 2020 16:50:33 -0400 Subject: [PATCH] Create verify script for CI jobs Issue-ID: INT-109 Signed-off-by: Zhe Huang Change-Id: Ia2f7faa3e2b700965a2adbb00fc24d2bb5e25d1b --- bin/verify-ric-charts | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/bin/verify-ric-charts b/bin/verify-ric-charts index 69fc49f..4452a09 100755 --- a/bin/verify-ric-charts +++ b/bin/verify-ric-charts @@ -19,12 +19,26 @@ # 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 -- 2.16.6