Consolidate configurations to recipes. Add 5 second delay for Kong deployment due...
[it/dep.git] / ric-infra / 30-Kong / bin / uninstall
index 01c97e0..b7ce8f3 100755 (executable)
 
 
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
 
+COMPONENTS="kong"
 
-source $DIR/../etc/kong.conf
+echo "Undeploying RIC infra components [$COMPONENTS]"
 
-if [ -z "$RICINFRA_RELEASE_NAME" ];then
-   RELEASE_NAME=$helm_release_name
-else
-   RELEASE_NAME=$RICINFRA_RELEASE_NAME
-fi
 
-if [ -z "$RICINFRA_NAMESPACE" ];then
-   INFRA_NAMESPACE=$infra_namespace
-else
-   INFRA_NAMESPACE=$RICINFRA_NAMESPACE
-fi
 
-RICINFRA_COMPONENTS="kong"
+for component in $COMPONENTS; do
+    RELEASE_LIST=$(helm list | grep "$component" | awk '{print $1}')
+    if [ ! -z "$RELEASE_LIST" ];then
+        helm delete --purge $RELEASE_LIST
+    fi
 
-echo "Undeploying RIC infra components [$RICINFRA_COMPONENTS]"
-echo "Helm Release Name: $RELEASE_NAME"
-
-
-for component in $RICINFRA_COMPONENTS; do
-  helm delete --purge  "${RELEASE_NAME}-${component}" 
 done
 
-