Check if servecm (Chart Manager) is already installed. 42/10842/2
authorTaewan Kim <t25.kim@samsung.com>
Wed, 5 Apr 2023 08:21:06 +0000 (17:21 +0900)
committerTaewan Kim <t25.kim@samsung.com>
Thu, 6 Apr 2023 06:11:14 +0000 (15:11 +0900)
Issue-ID: AIMLFW-43

Signed-off-by: Taewan Kim <t25.kim@samsung.com>
Change-Id: I443c8f0a309d1f5ad20b6869988d67a1d8e9db5e

bin/install_common_templates_to_helm.sh

index 88e8c10..3b8eaf9 100755 (executable)
 # ==================================================================================
 
 #!/bin/bash
+#set -e
 
-echo "Installing servecm (Chart Manager) and common templates to helm3"
+if [ -z $(helm plugin list | grep servecm | awk '{print $1}') ];
+then
+        echo "Installing servecm (Chart Manager) and common templates to helm3"
 
-helm plugin install https://github.com/jdolitsky/helm-servecm
-eval $(helm env |grep HELM_REPOSITORY_CACHE) 
-echo ${HELM_REPOSITORY_CACHE}
+        helm plugin install https://github.com/jdolitsky/helm-servecm
+        eval $(helm env | grep HELM_REPOSITORY_CACHE)
+        echo ${HELM_REPOSITORY_CACHE}
+else
+        echo "Found servecm in the helm plugin list. Skip servecm installation."
+fi
 
 #The hardcoded location does not work anymore, Reference: change similar to RIC-966 updating chartmuseum and docker refs
 curl -LO https://get.helm.sh/chartmuseum-v0.15.0-linux-386.tar.gz