X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=bin%2Fverify-ric-charts;h=2a8b9e654f50dc885f604f1e74de53e8810c641e;hb=2a9da683b5770657737f16535320fd66cac5ba9e;hp=6cadf7ccd5e17aa29c401a810559575d636cb8ba;hpb=faf7b36c0139e5324751115616f949f4e204b28c;p=ric-plt%2Fric-dep.git diff --git a/bin/verify-ric-charts b/bin/verify-ric-charts index 6cadf7c..2a8b9e6 100755 --- a/bin/verify-ric-charts +++ b/bin/verify-ric-charts @@ -34,7 +34,7 @@ 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 @@ -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 @@ -88,24 +87,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