Consolidate configurations to recipes. Add 5 second delay for Kong deployment due... 22/922/6
authorZhe Huang <zhehuang@research.att.com>
Mon, 9 Sep 2019 20:56:35 +0000 (16:56 -0400)
committerLusheng Ji <lji@research.att.com>
Thu, 12 Sep 2019 03:20:22 +0000 (03:20 +0000)
Signed-off-by: Zhe Huang <zhehuang@research.att.com>
Change-Id: I0f63bd7c4f95760a8a37835fa37ed691641b721b

37 files changed:
RECIPE_EXAMPLE/RIC_AUX_RECIPE_EXAMPLE
RECIPE_EXAMPLE/RIC_INFRA_RECIPE_EXAMPLE
RECIPE_EXAMPLE/RIC_PLATFORM_RECIPE_EXAMPLE
bin/clean-up-aux [deleted file]
bin/deploy-ric-aux
bin/deploy-ric-infra
bin/deploy-ric-platform
bin/undeploy-ric-aux
bin/undeploy-ric-infra
bin/undeploy-ric-platform
etc/ric-infra.conf [deleted file]
ric-aux/80-Auxiliary-Functions/bin/install
ric-aux/80-Auxiliary-Functions/bin/uninstall
ric-aux/80-Auxiliary-Functions/etc/aux.conf [deleted file]
ric-aux/85-Ext-Services/bin/install
ric-aux/85-Ext-Services/bin/uninstall
ric-aux/85-Ext-Services/etc/ext.conf [deleted file]
ric-infra/15-Chartmuseum/bin/install
ric-infra/15-Chartmuseum/bin/uninstall
ric-infra/15-Chartmuseum/etc/chartmuseum.conf [deleted file]
ric-infra/20-Monitoring/bin/install
ric-infra/20-Monitoring/bin/uninstall
ric-infra/20-Monitoring/etc/elfkp.conf [deleted file]
ric-infra/30-Kong/bin/install
ric-infra/30-Kong/bin/uninstall
ric-infra/30-Kong/etc/kong.conf [deleted file]
ric-infra/40-Credential/bin/install
ric-infra/40-Credential/bin/uninstall
ric-infra/40-Credential/etc/credential.conf [deleted file]
ric-infra/45-Tiller/bin/install
ric-infra/45-Tiller/bin/uninstall
ric-infra/45-Tiller/etc/tiller.conf [deleted file]
ric-platform/50-RIC-Platform/bin/install
ric-platform/50-RIC-Platform/bin/uninstall
ric-platform/50-RIC-Platform/etc/ric.conf [deleted file]
ric-platform/55-Ext-Services/bin/install
ric-platform/55-Ext-Services/bin/uninstall

index a6b11f4..d2249c8 100644 (file)
 # Global common setting
 #-------------------------------------------------------------------------
 global:
+  releasePrefix: r1
+  namespace:
+    xapp: ricxapp
+    infra: ricinfra
+    platform: ricplt
+    aux: ricaux
   # Docker registry from which RIC platform components pull the images
   repository: nexus3.o-ran-sc.org:10004
 
@@ -103,6 +109,7 @@ dashboard:
     # internal URL for backend
     ecomp_rest_url:     http://portal-app.onap:8989/ONAPPORTAL/auxapi
     ueb_app_key: uebkey
+  datapath: /opt/data/dashboard-data
 
 extsvcaux:
   ricip:
index 7a66bb1..8a06aed 100644 (file)
 # Global common setting
 #-------------------------------------------------------------------------
 global:
+  releasePrefix: r1
+  namespace:
+    xapp: ricxapp
+  
+    infra: ricinfra
+    platform: ricplt
+    aux: ricaux
   # Docker registry from which RIC platform components pull the images
   repository: nexus3.o-ran-sc.org:10004
 
@@ -83,12 +90,6 @@ global:
 # Infrastructure
 #-------------------------------------------------------------------------
 
-cluster:
-  deployK8S: false
-  deployNexus: false
-  deployK8SMonitoringStack: false
-  useLocalHelmRepo: true
-  useLocalDockerRegistry: false
 
 credential:
   repositoryCredential:
@@ -105,8 +106,11 @@ credential:
     <CERT FOR HELM>
     -----END CERTIFICATE-----
 
+k8s:
+  enable: false
 
 chartmuseum:
+  enable: false
   repositoryOverride: "docker.io"
   image:
     name: chartmuseum/chartmuseum
@@ -115,5 +119,9 @@ chartmuseum:
     image:
       name: alpine
       tag: latest
-
   storagesize: 2Gi
+  datapath: /opt/data/chartmuseum-data
+
+elfkp:
+  enable: false
+
index 0d9f1cc..8b03599 100644 (file)
 # Global common setting
 #-------------------------------------------------------------------------
 global:
+  releasePrefix: r1
+  namespace:
+    xapp: ricxapp
+    infra: ricinfra
+    platform: ricplt
+    aux: ricaux
   # Docker registry from which RIC platform components pull the images
   repository: nexus3.o-ran-sc.org:10004
 
diff --git a/bin/clean-up-aux b/bin/clean-up-aux
deleted file mode 100755 (executable)
index e36393b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-################################################################################
-#   Copyright (c) 2019 AT&T Intellectual Property.                             #
-#   Copyright (c) 2019 Nokia.                                                  #
-#                                                                              #
-#   Licensed under the Apache License, Version 2.0 (the "License");            #
-#   you may not use this file except in compliance with the License.           #
-#   You may obtain a copy of the License at                                    #
-#                                                                              #
-#       http://www.apache.org/licenses/LICENSE-2.0                             #
-#                                                                              #
-#   Unless required by applicable law or agreed to in writing, software        #
-#   distributed under the License is distributed on an "AS IS" BASIS,          #
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
-#   See the License for the specific language governing permissions and        #
-#   limitations under the License.                                             #
-################################################################################
-
-# This script clean up the PV data for aux cluster
-
-rm -rf /opt/data/dashboard-data
-rm -rf /opt/data/chartmuseum-data
index 8a4546f..c517862 100755 (executable)
 
 # This script deploys RIC aux components automatically
 
-OVERRIDEYAML=$1
+if [ "$#" -eq 1 ]; then
+    OVERRIDEYAML=$1
+else
 
-if [ -z "$OVERRIDEYAML" ];then
-echo "****************************************************************************************************************"
-echo "                                                     WARNING                                                    "
-echo "****************************************************************************************************************"
-echo "Deploying RIC auxiliary without deployment recipe. Default configurations are used."
-echo "****************************************************************************************************************"
+    while [ -n "$1" ]; do # while loop starts
 
-fi
+        case "$1" in
 
+        -f) OVERRIDEYAML=$2
+            shift
+            ;;
+        *) echo "Option $1 not recognized" ;; # In case you typed a different option other than a,b,c
 
-ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+        esac
 
-source $ROOT_DIR/../etc/ric.conf
+        shift
 
+    done
+fi
 
-export RICAUX_RELEASE_NAME=$helm_release_name
 
-export RICPLT_NAMESPACE=$plt_namespace
-export RICXAPP_NAMESPACE=$xapp_namespace
-export RICAUX_NAMESPACE=$aux_namespace
-export RICINFRA_NAMESPACE=$infra_namespace
+if [ -z "$OVERRIDEYAML" ];then
+    echo "****************************************************************************************************************"
+    echo "                                                     ERROR                                                      "
+    echo "****************************************************************************************************************"
+    echo "RIC deployment without deployment recipe is currently disabled. Please specify an recipe with the -f option."
+    echo "****************************************************************************************************************"
+    exit 1
+fi
+
+
+ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
 
 for component in $ROOT_DIR/../ric-aux/*/; do
     # Will print */ if no directories are available
-    . $component/bin/install $OVERRIDEYAML
+    . $component/bin/install -f $OVERRIDEYAML
 
 done
 
index cc36c68..a5cb94b 100755 (executable)
 #   limitations under the License.                                             #
 ################################################################################
 
-# This script deploys RIC platform components automatically
-
-OVERRIDEYAML=$1
-
-if [ -z "$OVERRIDEYAML" ];then
-echo "****************************************************************************************************************"
-echo "                                                     WARNING                                                    "
-echo "****************************************************************************************************************"
-echo "Preparing the clusters for RIC deployment without deployment recipe. Default configurations are used."
-echo "****************************************************************************************************************"
-
-
-fi
-
-
-ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
-
-source $ROOT_DIR/../etc/ric.conf
-source $ROOT_DIR/../etc/ric-infra.conf
+if [ "$#" -eq 1 ]; then
+    OVERRIDEYAML=$1
+else
 
+    while [ -n "$1" ]; do # while loop starts
 
-export RICINFRA_RELEASE_NAME=$helm_release_name
+        case "$1" in
 
-export RICPLT_NAMESPACE=$plt_namespace
-export RICXAPP_NAMESPACE=$xapp_namespace
-export RICAUX_NAMESPACE=$aux_namespace
-export RICINFRA_NAMESPACE=$infra_namespace
+        -f) OVERRIDEYAML=$2
+            shift
+            ;;
+        *) echo "Option $1 not recognized" ;; # In case you typed a different option other than a,b,c
 
+        esac
 
-if [ ! -z $OVERRIDEYAML ]; then
-       DEPLOY_K8S_FROM_OVERRIDE=$(cat $OVERRIDEYAML | grep deployK8S: | awk '{print $2}')
-       USE_LOCAL_HELM_REPO_FROM_OVERRIDE=$(cat $OVERRIDEYAML | grep useLocalHelmRepo: | awk '{print $2}')
-       USE_LOCAL_DOCKER_REGISTRY_FROM_OVERRIDE=$(cat $OVERRIDEYAML | grep useLocalDockerRegistry: | awk '{print $2}')
-       DEPLOY_K8S_MONITORING_FROM_OVERRIDE=$(cat $OVERRIDEYAML | grep deployK8SMonitoringStake: | awk '{print $2}')
-fi
+        shift
 
-if [ -z $DEPLOY_K8S_FROM_OVERRIDE ]; then
-       export DEPLOY_K8S=$deployK8S
-else
-       export DEPLOY_K8S=$DEPLOY_K8S_FROM_OVERRIDE
+    done
 fi
 
-if [ -z $USE_LOCAL_HELM_REPO_FROM_OVERRIDE ]; then
-       export USE_LOCAL_HELM_REPO=$useLocalHelmRepo
-else
-       export USE_LOCAL_HELM_REPO=$USE_LOCAL_HELM_REPO_FROM_OVERRIDE
-fi
 
-if [ -z $USE_LOCAL_DOCKER_REGISTRY_FROM_OVERRIDE ]; then
-       export USE_LOCAL_DOCKER_REGISTRY=$useLocalDockerRegistry
-else
-       export USE_LOCAL_DOCKER_REGISTRY=$USE_LOCAL_DOCKER_REGISTRY_FROM_OVERRIDE
-fi
 
-if [ -z $DEPLOY_K8S_MONITORING_FROM_OVERRIDE ]; then
-       export DEPLOY_K8S_MONITORING=$deployK8S
-else
-       export DEPLOY_K8S_MONITORING=$DEPLOY_K8S_MONITORING_FROM_OVERRIDE
+if [ -z "$OVERRIDEYAML" ];then
+    echo "****************************************************************************************************************"
+    echo "                                                     ERROR                                                      "
+    echo "****************************************************************************************************************"
+    echo "RIC deployment without deployment recipe is currently disabled. Please specify an recipe with the -f option."
+    echo "****************************************************************************************************************"
+    exit 1
 fi
 
 
-if ! $USE_LOCAL_HELM_REPO; then
-        echo "****************************************************************************************************************"
-        echo "                                                     WARNING                                                    "
-        echo "****************************************************************************************************************"
-        echo "RIC will use an external helm repository. Please make sure that the certificate is included in the recipe file."
-        echo "****************************************************************************************************************"
-fi
+ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
 
 
-if $USE_LOCAL_DOCKER_REGISTRY; then
-        echo "****************************************************************************************************************"
-        echo "                                                     WARNING                                                    "
-        echo "****************************************************************************************************************"
-        echo "RIC will use an internal docker registry. You need to manually include the certificate to all servers in the cluster."
-        echo "****************************************************************************************************************"
-fi
+CHARTMUSEUM_BLOCK=$(cat $OVERRIDEYAML | awk '/^chartmuseum:/{getline; while ($0 ~ /^ +.*|^ *$/) {print $0; if (getline == 0) {break}}}')
+ELFKP_BLOCK=$(cat $OVERRIDEYAML | awk '/^elfkp:/{getline; while ($0 ~ /^ +.*|^ *$/) {print $0; if (getline == 0) {break}}}')
+K8S_BLOCK=$(cat $OVERRIDEYAML | awk '/^k8s:/{getline; while ($0 ~ /^ +.*|^ *$/) {print $0; if (getline == 0) {break}}}')
 
+USE_LOCAL_HELM_REPO=$(echo "$CHARTMUSEUM_BLOCK" | grep "enable" | awk '{print $2}')
+DEPLOY_K8S=$(echo "$K8S_BLOCK" | grep "enable" | awk '{print $2}')
+DEPLOY_K8S_MONITORING=$(echo "$ELFKP_BLOCK" | grep "enable" | awk '{print $2}')
 
 
 for component in $ROOT_DIR/../ric-infra/*/; do
@@ -101,27 +65,26 @@ for component in $ROOT_DIR/../ric-infra/*/; do
 
        case "$component_name" in
                00-Kubernetes)
-                       if $DEPLOY_K8S; then
-                               . $component/bin/install $OVERRIDEYAM
-                       fi
-               ;;
-               10-Nexus)
-                       if $USE_LOCAL_DOCKER_REGISTRY; then
-                               . $component/bin/install $OVERRIDEYAM
+                       if [ "$DEPLOY_K8S" == "true" ];then
+                               . $component/bin/install -f $OVERRIDEYAML
                        fi
                ;;
                15-Chartmuseum)
-                       if $USE_LOCAL_HELM_REPO; then
-                               . $component/bin/install $OVERRIDEYAM
+                       if [ "$USE_LOCAL_HELM_REPO" == "true" ];then
+                               . $component/bin/install -f $OVERRIDEYAML
                        fi
                ;;
                20-Monitoring)
-                       if $DEPLOY_K8S_MONITORING; then
-                               . $component/bin/install $OVERRIDEYAM
+                       if [ "$DEPLOY_K8S_MONITORING" == "true" ];then
+                               . $component/bin/install -f $OVERRIDEYAML
                        fi
                ;;
+               30-Kong)
+                        . $component/bin/install -f $OVERRIDEYAML
+                        sleep 5
+                ;;
                *)
-                   . $component/bin/install $OVERRIDEYAM
+                   . $component/bin/install -f $OVERRIDEYAML
        
        esac
 done
index b19a471..0826ba6 100755 (executable)
 
 # This script deploys RIC platform components automatically
 
-OVERRIDEYAML=$1
+if [ "$#" -eq 1 ]; then
+    OVERRIDEYAML=$1
+else
 
-if [ -z "$OVERRIDEYAML" ];then
-echo "****************************************************************************************************************"
-echo "                                                     WARNING                                                    "
-echo "****************************************************************************************************************"
-echo "Deploying RIC platform without deployment recipe. Default configurations are used."
-echo "****************************************************************************************************************"
+    while [ -n "$1" ]; do # while loop starts
 
+        case "$1" in
 
-fi
+        -f) OVERRIDEYAML=$2
+            shift
+            ;;
+        *) echo "Option $1 not recognized" ;; # In case you typed a different option other than a,b,c
 
+        esac
 
-ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+        shift
 
-source $ROOT_DIR/../etc/ric.conf
+    done
+fi
 
 
-export RICPLT_RELEASE_NAME=$helm_release_name
+if [ -z "$OVERRIDEYAML" ];then
+    echo "****************************************************************************************************************"
+    echo "                                                     ERROR                                                      "
+    echo "****************************************************************************************************************"
+    echo "RIC deployment without deployment recipe is currently disabled. Please specify an recipe with the -f option."
+    echo "****************************************************************************************************************"
+    exit 1
+fi
+
 
-export RICPLT_NAMESPACE=$plt_namespace
-export RICXAPP_NAMESPACE=$xapp_namespace
-export RICAUX_NAMESPACE=$aux_namespace
-export RICINFRA_NAMESPACE=$infra_namespace
+
+ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
 
 for component in $ROOT_DIR/../ric-platform/*/; do
     # Will print */ if no directories are available
-    . $component/bin/install $OVERRIDEYAML
+    . $component/bin/install -f $OVERRIDEYAML
 
 done
 
index 735dfbf..1fa96dc 100755 (executable)
 
 ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
 
-source $ROOT_DIR/../etc/ric.conf
-
-export RICAUX_RELEASE_NAME=$helm_release_name
-
-export RICAUX_NAMESPACE=$aux_namespace
-
 
 for component in $ROOT_DIR/../ric-aux/*/; do
     # Will print */ if no directories are available
index ea8ab35..9b2f53d 100755 (executable)
 
 ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
 
-source $ROOT_DIR/../etc/ric.conf
-source $ROOT_DIR/../etc/ric-infra.conf
-
-
-export RICINFRA_RELEASE_NAME=$helm_release_name
-
-export RICPLT_NAMESPACE=$plt_namespace
-export RICXAPP_NAMESPACE=$xapp_namespace
-export RICAUX_NAMESPACE=$aux_namespace
-export RICINFRA_NAMESPACE=$infra_namespace
-
 
 for component in $ROOT_DIR/../ric-infra/*/; do
     # Will print */ if no directories are available
index adeea6a..574baae 100755 (executable)
 
 ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
 
-source $ROOT_DIR/../etc/ric.conf
-
-export RICPLT_RELEASE_NAME=$helm_release_name
-
-export RICPLT_NAMESPACE=$plt_namespace
-
 
 for component in $ROOT_DIR/../ric-platform/*/; do
     # Will print */ if no directories are available
diff --git a/etc/ric-infra.conf b/etc/ric-infra.conf
deleted file mode 100644 (file)
index a442a8f..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-################################################################################
-#   Copyright (c) 2019 AT&T Intellectual Property.                             #
-#   Copyright (c) 2019 Nokia.                                                  #
-#                                                                              #
-#   Licensed under the Apache License, Version 2.0 (the "License");            #
-#   you may not use this file except in compliance with the License.           #
-#   You may obtain a copy of the License at                                    #
-#                                                                              #
-#       http://www.apache.org/licenses/LICENSE-2.0                             #
-#                                                                              #
-#   Unless required by applicable law or agreed to in writing, software        #
-#   distributed under the License is distributed on an "AS IS" BASIS,          #
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
-#   See the License for the specific language governing permissions and        #
-#   limitations under the License.                                             #
-################################################################################
-
-
-
-# deploy the kubernete cluster
-deployK8S=false
-
-# use the local helm repo
-useLocalHelmRepo=true
-
-# use the local docker registry
-useLocalDockerRegistry=true
index 0d84373..916e067 100755 (executable)
 ################################################################################
 
 
-OVERRIDEYAML=$1
+while [ -n "$1" ]; do # while loop starts
 
+    case "$1" in
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+    -f) OVERRIDEYAML=$2
+        shift
+        ;;
+    -c) LIST_OF_COMPONENTS=$2
+        shift
+        ;;
+    *) echo "Option $1 not recognized" ;; # In case you typed a different option other than a,b,c
 
+    esac
 
-source $DIR/../etc/aux.conf
+    shift
 
-if [ -z "$RICAUX_RELEASE_NAME" ];then
-   RELEASE_NAME=$helm_release_name
-else
-   RELEASE_NAME=$RICAUX_RELEASE_NAME
-fi
+done
 
-# Namespace configuration
-if [ -z "$RICPLT_NAMESPACE" ];then
-   PLT_NAMESPACE=$plt_namespace
-else
-   PLT_NAMESPACE=$RICPLT_NAMESPACE
-fi
-if [ -z "$RICXAPP_NAMESPACE" ];then
-   XAPP_NAMESPACE=$xapp_namespace
-else
-   XAPP_NAMESPACE=$RICXAPP_NAMESPACE
-fi
-if [ -z "$RICAUX_NAMESPACE" ];then
-   AUX_NAMESPACE=$aux_namespace
-else
-   AUX_NAMESPACE=$RICAUX_NAMESPACE
-fi
-if [ -z "$RICINFRA_NAMESPACE" ];then
-   INFRA_NAMESPACE=$infra_namespace
-else
-   INFRA_NAMESPACE=$RICINFRA_NAMESPACE
-fi
 
-if [ -z "$RIC_COMMON_OVERRIDE" ];then
-   COMMON_OVERRIDE="--set global.namespace.platform=$PLT_NAMESPACE --set global.namespace.xapp=$XAPP_NAMESPACE --set global.namespace.aux=$AUX_NAMESPACE --set global.namespace.infra=$INFRA_NAMESPACE"
-else
-   COMMON_OVERRIDE=$RIC_COMMON_OVERRIDE
+if [ -z "$OVERRIDEYAML" ];then
+    echo "****************************************************************************************************************"
+    echo "                                                     ERROR                                                      "
+    echo "****************************************************************************************************************"
+    echo "RIC deployment without deployment recipe is currently disabled. Please specify an recipe with the -f option."
+    echo "****************************************************************************************************************"
+    exit 1
 fi
 
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+GLOBAL_BLOCK=$(cat $OVERRIDEYAML | awk '/^global:/{getline; while ($0 ~ /^ +.*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE_BLOCK=$(cat $OVERRIDEYAML | awk '/^  namespace:/{getline; while ($0 ~ /^    .*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *aux:/{print $2}')
+RELEASE_PREFIX=$(echo "$GLOBAL_BLOCK" | awk '/^ *releasePrefix:/{print $2}')
+COMPONENTS=${LIST_OF_COMPONENTS:-"dashboard ves message-router mrsub"}
+
 
 
 NODENAME=$(kubectl get node | awk '{print $1}')
@@ -70,10 +63,7 @@ for f in $NODENAME; do
     fi
 done
   
-if [ ! -z $OVERRIDEYAML ]; then
-  FOUND_STORAGECLASS=$(grep storageclass $OVERRIDEYAML)
-fi
-
+FOUND_STORAGECLASS=$(grep storageclass $OVERRIDEYAML)
 
 
 if  ! $LABELFOUND && [ -z "$FOUND_STORAGECLASS" ]; then
@@ -85,12 +75,10 @@ if  ! $LABELFOUND && [ -z "$FOUND_STORAGECLASS" ]; then
     echo "* kubectl label --overwrite nodes <YOUR_NODE_NAME> local-storage=enable                       *"
     echo "***********************************************************************************************"
 
-  exit 1
+    exit 1
 fi
 
 
-
-
 if [ -z "$FOUND_STORAGECLASS" ] && $LABELFOUND; then
 
     DATAPATH=$(cat $DIR/../helm/dashboard/values.yaml | grep datapath | awk '{ print $2}' )
@@ -104,44 +92,36 @@ if [ -z "$FOUND_STORAGECLASS" ] && $LABELFOUND; then
         DATAPATH=$DATAPATHOVERRIDE
     fi
 
+    if [ ! -d "$DATAPATH" ]; then
+        mkdir -p $DATAPATH || { echo "Directory $DATAPATH does not exist and you don't have permission to create it. Please choose a different datapath." ; exit 1 ; }
+    fi
 
     echo "***********************************************************************************************"
     echo "*                                          WARNING!!!!!!!!!!!!!                               *"
     echo "***********************************************************************************************"
-    echo "* Chartmuseume will use local storage. Please make sure that directory                        *"
+    echo "* Dashboard will use local storage. Please make sure that directory                           *"
     echo "* $DATAPATH                                                                                   *"
-    echo "* exists on the selected cluster node, and contains the proper files.                         *"
+    echo "* contains the proper files.                                                                  *"
     echo "***********************************************************************************************"
 
-
 fi
 
-
-
-
-
-
-
-RICAUX_COMPONENTS="dashboard mrsub ves message-router"
-
-echo "Deploying RIC AUX components [$RICAUX_COMPONENTS]"
-echo "Helm Release Name: $RELEASE_NAME"
-
+echo "Deploying RIC infra components [$COMPONENTS]"
 
 COMMON_CHART_VERSION=$(cat $DIR/../../../ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}')
-
-
-helm package -d /tmp $DIR/../../../ric-common/Common-Template/helm/ric-common/
-
-
-for component in $RICAUX_COMPONENTS; do
-  echo "Preparing chart for comonent $component"
-
-  mkdir -p  $DIR/../helm/$component/charts/
-  cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/$component/charts/
-  if [ -z $OVERRIDEYAML ]; then
-  helm install --namespace $AUX_NAMESPACE --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component
-  else
-  helm install -f $OVERRIDEYAML --namespace $AUX_NAMESPACE --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component
-  fi
-done
+helm package -d /tmp $DIR/../../../ric-common/Common-Template/helm/ric-common
+
+
+for component in $COMPONENTS; do
+    case "$component" in
+            dashboard | ves | message-router | mrsub)
+                mkdir -p $DIR/../helm/$component/charts/
+                cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/$component/charts/
+                helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_PREFIX}-$component" $DIR/../helm/$component
+            ;;
+            *)
+                helm install --namespace "${NAMESPACE}" --name "${RELEASE_PREFIX}-$component" $DIR/../helm/$component
+    esac
+
+done
\ No newline at end of file
index 85d3b5c..2f26691 100755 (executable)
 ################################################################################
 
 
+COMPONENTS="dashboard message-router ves mrsub"
 
+echo "Undeploying RIC aux components [$COMPONENTS]"
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
 
 
-source $DIR/../etc/aux.conf
+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
 
-if [ -z "$RICAUX_RELEASE_NAME" ];then
-   RELEASE_NAME=$helm_release_name
-else
-   RELEASE_NAME=$RICAUX_RELEASE_NAME
-fi
-
-RICAUX_COMPONENTS="dashboard message-router ves mrsub"
-
-echo "Undeploying RIC AUX components [$RICAUX_COMPONENTS]"
-echo "Helm Release Name: $RELEASE_NAME"
-
-
-
-for component in $RICAUX_COMPONENTS; do
-  helm delete --purge  "${RELEASE_NAME}-$component" 
 done
diff --git a/ric-aux/80-Auxiliary-Functions/etc/aux.conf b/ric-aux/80-Auxiliary-Functions/etc/aux.conf
deleted file mode 100644 (file)
index 98680ed..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-################################################################################
-#   Copyright (c) 2019 AT&T Intellectual Property.                             #
-#   Copyright (c) 2019 Nokia.                                                  #
-#                                                                              #
-#   Licensed under the Apache License, Version 2.0 (the "License");            #
-#   you may not use this file except in compliance with the License.           #
-#   You may obtain a copy of the License at                                    #
-#                                                                              #
-#       http://www.apache.org/licenses/LICENSE-2.0                             #
-#                                                                              #
-#   Unless required by applicable law or agreed to in writing, software        #
-#   distributed under the License is distributed on an "AS IS" BASIS,          #
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
-#   See the License for the specific language governing permissions and        #
-#   limitations under the License.                                             #
-################################################################################
-
-
-# helm_release_name defines the release name helm will use to deploy RIC
-# It will be overrided by RICPLT_RELEASE_NAME
-helm_release_name=r1
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICPLT_NAMESPACE
-plt_namespace=ricplt
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICXAPP_NAMESPACE
-xapp_namespace=ricxapp
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICAUX_NAMESPACE
-aux_namespace=onap
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICINFRA_NAMESPACE
-infra_namespace=ricinfra
index 59f01ca..805950e 100755 (executable)
 #   limitations under the License.                                             #
 ################################################################################
 
+while [ -n "$1" ]; do # while loop starts
 
-OVERRIDEYAML=$1
+    case "$1" in
 
+    -f) OVERRIDEYAML=$2
+        shift
+        ;;
+    -c) LIST_OF_COMPONENTS=$2
+        shift
+        ;;
+    *) echo "Option $1 not recognized" ;; # In case you typed a different option other than a,b,c
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+    esac
 
-source $DIR/../etc/ext.conf
+    shift
 
-if [ -z "$RICAUX_RELEASE_NAME" ];then
-   RELEASE_NAME=$helm_release_name
-else
-   RELEASE_NAME=$RICAUX_RELEASE_NAME
-fi
+done
 
-# Namespace configuration
-if [ -z "$RICPLT_NAMESPACE" ];then
-   PLT_NAMESPACE=$plt_namespace
-else
-   PLT_NAMESPACE=$RICPLT_NAMESPACE
-fi
-if [ -z "$RICXAPP_NAMESPACE" ];then
-   XAPP_NAMESPACE=$xapp_namespace
-else
-   XAPP_NAMESPACE=$RICXAPP_NAMESPACE
-fi
-if [ -z "$RICAUX_NAMESPACE" ];then
-   AUX_NAMESPACE=$aux_namespace
-else
-   AUX_NAMESPACE=$RICAUX_NAMESPACE
-fi
-if [ -z "$RICINFRA_NAMESPACE" ];then
-   INFRA_NAMESPACE=$infra_namespace
-else
-   INFRA_NAMESPACE=$RICINFRA_NAMESPACE
-fi
 
-if [ -z "$RIC_COMMON_OVERRIDE" ];then
-   COMMON_OVERRIDE="--set global.namespace.platform=$PLT_NAMESPACE --set global.namespace.xapp=$XAPP_NAMESPACE --set global.namespace.aux=$AUX_NAMESPACE --set global.namespace.infra=$INFRA_NAMESPACE"
-else
-   COMMON_OVERRIDE=$RIC_COMMON_OVERRIDE
+if [ -z "$OVERRIDEYAML" ];then
+    echo "****************************************************************************************************************"
+    echo "                                                     ERROR                                                      "
+    echo "****************************************************************************************************************"
+    echo "RIC deployment without deployment recipe is currently disabled. Please specify an recipe with the -f option."
+    echo "****************************************************************************************************************"
+    exit 1
 fi
 
-RICAUX_COMPONENTS="extsvcaux"
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+GLOBAL_BLOCK=$(cat $OVERRIDEYAML | awk '/^global:/{getline; while ($0 ~ /^ +.*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE_BLOCK=$(cat $OVERRIDEYAML | awk '/^  namespace:/{getline; while ($0 ~ /^    .*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *aux:/{print $2}')
+RELEASE_PREFIX=$(echo "$GLOBAL_BLOCK" | awk '/^ *releasePrefix:/{print $2}')
+COMPONENTS=${LIST_OF_COMPONENTS:-"extsvcaux"}
 
-echo "Deploying RIC AUX components [$RICAUX_COMPONENTS]"
-echo "Helm Release Name: $RELEASE_NAME"
+echo "Deploying RIC infra components [$COMPONENTS]"
 
 
 COMMON_CHART_VERSION=$(cat $DIR/../../../ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}')
+helm package -d /tmp $DIR/../../../ric-common/Common-Template/helm/ric-common
 
-helm package -d /tmp $DIR/../../../ric-common/Common-Template/helm/ric-common/
 
+for component in $COMPONENTS; do
 
-for component in $RICAUX_COMPONENTS; do
-  echo "Preparing chart for comonent $component"
-  mkdir -p  $DIR/../helm/$component/charts/
+  mkdir -p $DIR/../helm/$component/charts/
   cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/$component/charts/
-  if [ -z $OVERRIDEYAML ]; then
-  helm install --debug --namespace $AUX_NAMESPACE --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component
-  else
-  helm install -f $OVERRIDEYAML --namespace $AUX_NAMESPACE --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component
-  fi
+  helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_PREFIX}-$component" $DIR/../helm/$component
 done
index ad8dac6..02cee0e 100755 (executable)
 #   See the License for the specific language governing permissions and        #
 #   limitations under the License.                                             #
 ################################################################################
+COMPONENTS="extsvcaux"
 
+echo "Undeploying RIC platform components [$COMPONENTS]"
 
 
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+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
 
-
-source $DIR/../etc/ext.conf
-
-if [ -z "$RICAUX_RELEASE_NAME" ];then
-   RELEASE_NAME=$helm_release_name
-else
-   RELEASE_NAME=$RICAUX_RELEASE_NAME
-fi
-
-RICAUX_COMPONENTS="extsvcaux"
-
-echo "Undeploying RIC AUX components [$RICAUX_COMPONENTS]"
-echo "Helm Release Name: $RELEASE_NAME"
-
-
-
-for component in $RICAUX_COMPONENTS; do
-  helm delete --purge  "${RELEASE_NAME}-$component" 
 done
diff --git a/ric-aux/85-Ext-Services/etc/ext.conf b/ric-aux/85-Ext-Services/etc/ext.conf
deleted file mode 100644 (file)
index 92008b5..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-################################################################################
-#   Copyright (c) 2019 AT&T Intellectual Property.                             #
-#   Copyright (c) 2019 Nokia.                                                  #
-#                                                                              #
-#   Licensed under the Apache License, Version 2.0 (the "License");            #
-#   you may not use this file except in compliance with the License.           #
-#   You may obtain a copy of the License at                                    #
-#                                                                              #
-#       http://www.apache.org/licenses/LICENSE-2.0                             #
-#                                                                              #
-#   Unless required by applicable law or agreed to in writing, software        #
-#   distributed under the License is distributed on an "AS IS" BASIS,          #
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
-#   See the License for the specific language governing permissions and        #
-#   limitations under the License.                                             #
-################################################################################
-
-
-# helm_release_name defines the release name helm will use to deploy RIC
-# It will be overrided by RICPLT_RELEASE_NAME
-helm_release_name=r1
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICPLT_NAMESPACE
-plt_namespace=ricplt
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICXAPP_NAMESPACE
-xapp_namespace=ricxapp
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICAUX_NAMESPACE
-aux_namespace=ricaux
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICINFRA_NAMESPACE
-infra_namespace=ricinfra
index 6a6fe8c..572ae3e 100755 (executable)
 ################################################################################
 
 
-OVERRIDEYAML=$1
+while [ -n "$1" ]; do # while loop starts
 
+    case "$1" in
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+    -f) OVERRIDEYAML=$2
+        shift
+        ;;
+    -c) LIST_OF_COMPONENTS=$2
+        shift
+        ;;
+    *) echo "Option $1 not recognized" ;; # In case you typed a different option other than a,b,c
 
-source $DIR/../etc/chartmuseum.conf
+    esac
 
-if [ -z "$RICINFRA_RELEASE_NAME" ];then
-   RELEASE_NAME=$helm_release_name
-else
-   RELEASE_NAME=$RICINFRA_RELEASE_NAME
-fi
-# Namespace configuration
-if [ -z "$RICPLT_NAMESPACE" ];then
-   PLT_NAMESPACE=$plt_namespace
-else
-   PLT_NAMESPACE=$RICPLT_NAMESPACE
-fi
-if [ -z "$RICXAPP_NAMESPACE" ];then
-   XAPP_NAMESPACE=$xapp_namespace
-else
-   XAPP_NAMESPACE=$RICXAPP_NAMESPACE
-fi
-if [ -z "$RICAUX_NAMESPACE" ];then
-   AUX_NAMESPACE=$aux_namespace
-else
-   AUX_NAMESPACE=$RICAUX_NAMESPACE
-fi
-if [ -z "$RICINFRA_NAMESPACE" ];then
-   INFRA_NAMESPACE=$infra_namespace
-else
-   INFRA_NAMESPACE=$RICINFRA_NAMESPACE
-fi
+    shift
 
-if [ -z "$RIC_COMMON_OVERRIDE" ];then
-   COMMON_OVERRIDE="--set global.namespace.platform=$PLT_NAMESPACE --set global.namespace.xapp=$XAPP_NAMESPACE --set global.namespace.aux=$AUX_NAMESPACE --set global.namespace.infra=$INFRA_NAMESPACE"
-else
-   COMMON_OVERRIDE=$RIC_COMMON_OVERRIDE
+done
+
+
+if [ -z "$OVERRIDEYAML" ];then
+    echo "****************************************************************************************************************"
+    echo "                                                     ERROR                                                      "
+    echo "****************************************************************************************************************"
+    echo "RIC deployment without deployment recipe is currently disabled. Please specify an recipe with the -f option."
+    echo "****************************************************************************************************************"
+    exit 1
 fi
 
 
 
-NODENAME=$(kubectl get node | awk '{print $1}')
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+GLOBAL_BLOCK=$(cat $OVERRIDEYAML | awk '/^global:/{getline; while ($0 ~ /^ +.*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE_BLOCK=$(cat $OVERRIDEYAML | awk '/^  namespace:/{getline; while ($0 ~ /^    .*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *infra:/{print $2}')
+RELEASE_PREFIX=$(echo "$GLOBAL_BLOCK" | awk '/^ *releasePrefix:/{print $2}')
+COMPONENTS=${LIST_OF_COMPONENTS:-"chartmuseum"}
+
+
+NODENAME=$(kubectl get node | awk 'NR>1{print $1}')
+
 LABELFOUND=false
 for f in $NODENAME; do
     LABEL=$(kubectl describe node $f | grep local-storage)
@@ -68,11 +65,7 @@ for f in $NODENAME; do
     fi
 done
 
-if [ ! -z $OVERRIDEYAML ]; then
-  FOUND_STORAGECLASS=$(grep storageclass $OVERRIDEYAML)
-fi
-
-
+FOUND_STORAGECLASS=$(grep storageclass $OVERRIDEYAML)
 
 if  ! $LABELFOUND && [ -z "$FOUND_STORAGECLASS" ]; then
     echo "***********************************************************************************************"
@@ -83,12 +76,9 @@ if  ! $LABELFOUND && [ -z "$FOUND_STORAGECLASS" ]; then
     echo "* kubectl label --overwrite nodes <YOUR_NODE_NAME> local-storage=enable                       *"
     echo "***********************************************************************************************"
 
-  exit 1
+    exit 1
 fi
 
-
-
-
 if [ -z "$FOUND_STORAGECLASS" ] && $LABELFOUND; then
 
     DATAPATH=$(cat $DIR/../helm/chartmuseum/values.yaml | grep datapath | awk '{ print $2}' )
@@ -102,38 +92,29 @@ if [ -z "$FOUND_STORAGECLASS" ] && $LABELFOUND; then
        DATAPATH=$DATAPATHOVERRIDE
     fi
 
+    if [ ! -d "$DATAPATH" ]; then
+       mkdir -p $DATAPATH || { echo "Directory $DATAPATH does not exist and you don't have permission to create it. Please choose a different datapath." ; exit 1 ; }
+    fi
 
     echo "***********************************************************************************************"
     echo "*                                          WARNING!!!!!!!!!!!!!                               *"
     echo "***********************************************************************************************"
     echo "* Chartmuseume will use local storage. Please make sure that directory                        *"
     echo "* $DATAPATH                                                                                   *"
-    echo "* exists on the selected cluster node, and contains the proper files.                         *"
+    echo "* contains the proper files.                                                                  *"
     echo "***********************************************************************************************"
-
-
 fi 
 
-RICINFRA_COMPONENTS="chartmuseum"
-
-echo "Deploying RIC infra components [$RICINFRA_COMPONENTS]"
-echo "Helm Release Name: $RELEASE_NAME"
+echo "Deploying RIC infra components [$COMPONENTS]"
 
 
 COMMON_CHART_VERSION=$(cat $DIR/../../../ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}')
 helm package -d /tmp $DIR/../../../ric-common/Common-Template/helm/ric-common
 
 
-
-for component in $RICINFRA_COMPONENTS; do
+for component in $COMPONENTS; do
 
   mkdir -p $DIR/../helm/$component/charts/
-
   cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/$component/charts/
-
-  if [ -z $OVERRIDEYAML ]; then
-    helm install --debug --namespace "${INFRA_NAMESPACE}" --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component
-  else
-    helm install -f $OVERRIDEYAML --namespace "${INFRA_NAMESPACE}" --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component
-  fi
+  helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_PREFIX}-$component" $DIR/../helm/$component
 done
index 79ca2d7..82d57a7 100755 (executable)
 #   limitations under the License.                                             #
 ################################################################################
 
+COMPONENTS="chartmuseum"
 
+echo "Undeploying RIC infra components [$COMPONENTS]"
 
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+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
 
-
-source $DIR/../etc/chartmuseum.conf
-
-if [ -z "$RICINFRA_RELEASE_NAME" ];then
-   RELEASE_NAME=$helm_release_name
-else
-   RELEASE_NAME=$RICINFRA_RELEASE_NAME
-fi
-
-RICINFRA_COMPONENTS="chartmuseum"
-
-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
diff --git a/ric-infra/15-Chartmuseum/etc/chartmuseum.conf b/ric-infra/15-Chartmuseum/etc/chartmuseum.conf
deleted file mode 100644 (file)
index 92008b5..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-################################################################################
-#   Copyright (c) 2019 AT&T Intellectual Property.                             #
-#   Copyright (c) 2019 Nokia.                                                  #
-#                                                                              #
-#   Licensed under the Apache License, Version 2.0 (the "License");            #
-#   you may not use this file except in compliance with the License.           #
-#   You may obtain a copy of the License at                                    #
-#                                                                              #
-#       http://www.apache.org/licenses/LICENSE-2.0                             #
-#                                                                              #
-#   Unless required by applicable law or agreed to in writing, software        #
-#   distributed under the License is distributed on an "AS IS" BASIS,          #
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
-#   See the License for the specific language governing permissions and        #
-#   limitations under the License.                                             #
-################################################################################
-
-
-# helm_release_name defines the release name helm will use to deploy RIC
-# It will be overrided by RICPLT_RELEASE_NAME
-helm_release_name=r1
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICPLT_NAMESPACE
-plt_namespace=ricplt
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICXAPP_NAMESPACE
-xapp_namespace=ricxapp
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICAUX_NAMESPACE
-aux_namespace=ricaux
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICINFRA_NAMESPACE
-infra_namespace=ricinfra
index 58274bf..c2819ae 100755 (executable)
 #   See the License for the specific language governing permissions and        #
 #   limitations under the License.                                             #
 ################################################################################
+while [ -n "$1" ]; do # while loop starts
 
+    case "$1" in
 
-OVERRIDEYAML=$1
+    -f) OVERRIDEYAML=$2
+        shift
+        ;;
+    -c) LIST_OF_COMPONENTS=$2
+        shift
+        ;;
+    *) echo "Option $1 not recognized" ;; # In case you typed a different option other than a,b,c
 
+    esac
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+    shift
 
-source $DIR/../etc/elfkp.conf
+done
 
-if [ -z "$RICINFRA_RELEASE_NAME" ];then
-   RELEASE_NAME=$helm_release_name
-else
-   RELEASE_NAME=$RICINFRA_RELEASE_NAME
-fi
-# Namespace configuration
-if [ -z "$RICPLT_NAMESPACE" ];then
-   PLT_NAMESPACE=$plt_namespace
-else
-   PLT_NAMESPACE=$RICPLT_NAMESPACE
-fi
-if [ -z "$RICXAPP_NAMESPACE" ];then
-   XAPP_NAMESPACE=$xapp_namespace
-else
-   XAPP_NAMESPACE=$RICXAPP_NAMESPACE
-fi
-if [ -z "$RICAUX_NAMESPACE" ];then
-   AUX_NAMESPACE=$aux_namespace
-else
-   AUX_NAMESPACE=$RICAUX_NAMESPACE
-fi
-if [ -z "$RICINFRA_NAMESPACE" ];then
-   INFRA_NAMESPACE=$infra_namespace
-else
-   INFRA_NAMESPACE=$RICINFRA_NAMESPACE
-fi
 
-if [ -z "$RIC_COMMON_OVERRIDE" ];then
-   COMMON_OVERRIDE="--set global.namespace.platform=$PLT_NAMESPACE --set global.namespace.xapp=$XAPP_NAMESPACE --set global.namespace.aux=$AUX_NAMESPACE --set global.namespace.infra=$INFRA_NAMESPACE"
-else
-   COMMON_OVERRIDE=$RIC_COMMON_OVERRIDE
+if [ -z "$OVERRIDEYAML" ];then
+    echo "****************************************************************************************************************"
+    echo "                                                     ERROR                                                      "
+    echo "****************************************************************************************************************"
+    echo "RIC deployment without deployment recipe is currently disabled. Please specify an recipe with the -f option."
+    echo "****************************************************************************************************************"
+    exit 1
 fi
 
-#helm install --name my-release stable/elastic-stack --set elasticsearch.data.persistence.enabled=false --set elasticsearch.master.persistence.enabled=false --set logstash.persistence.enabled=false 
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+GLOBAL_BLOCK=$(cat $OVERRIDEYAML | awk '/^global:/{getline; while ($0 ~ /^ +.*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE_BLOCK=$(cat $OVERRIDEYAML | awk '/^  namespace:/{getline; while ($0 ~ /^    .*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *infra:/{print $2}')
+RELEASE_PREFIX=$(echo "$GLOBAL_BLOCK" | awk '/^ *releasePrefix:/{print $2}')
+COMPONENTS=${LIST_OF_COMPONENTS:-"elfkp"}
+
+echo "Deploying RIC infra components [$COMPONENTS]"
 
-RICAUX_COMPONENTS="elfkp"
 
-echo "Deploying RIC infra components [$RICAUX_COMPONENTS]"
-echo "Helm Release Name: $RELEASE_NAME"
 
 
-for component in $RICAUX_COMPONENTS; do
+for component in $COMPONENTS; do
+
   mkdir -p $DIR/../helm/$component/charts/
   pushd $DIR/../helm/$component/
   helm dep update
   popd
 
-  ELASTIC_SEARCH_HOST="${RELEASE_NAME}-${component}-elasticsearch-client.${NAMESPACE}.svc.cluster.local"
-  ELASTIC_SEARCH_PORT=9200
+  #ELASTIC_SEARCH_HOST="${RELEASE_NAME}-${component}-elasticsearch-client.${NAMESPACE}.svc.cluster.local"
+  #ELASTIC_SEARCH_PORT=9200
   #CMD="helm install --debug \
   #   --namespace ${NAMESPACE} --name ${RELEASE_NAME}-${component_clean} \
   #   -f ../helm/$component/values.yaml \
@@ -81,10 +72,5 @@ for component in $RICAUX_COMPONENTS; do
   #   --set logstash.elasticsearch.host=${ELASTIC_SEARCH_PORT} \
   #   $component"
   #eval "$CMD"
-
-  if [ -z $OVERRIDEYAML ]; then
-    helm install --debug --namespace "${INFRA_NAMESPACE}" --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component
-  else
-    helm install -f $OVERRIDEYAML --namespace "${INFRA_NAMESPACE}" --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component
-  fi
+  helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_PREFIX}-$component" $DIR/../helm/$component
 done
index 8a3ba14..f9cccca 100755 (executable)
 #   See the License for the specific language governing permissions and        #
 #   limitations under the License.                                             #
 ################################################################################
+COMPONENTS="elfkp"
 
+echo "Undeploying RIC infra components [$COMPONENTS]"
 
 
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+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
 
-
-source $DIR/../etc/elfkp.conf
-
-if [ -z "$RICAUX_RELEASE_NAME" ];then
-   RELEASE_NAME=$helm_release_name
-else
-   RELEASE_NAME=$RICAUX_RELEASE_NAME
-fi
-
-RICAUX_COMPONENTS="elfkp"
-
-echo "Undeploying RIC AUX components [$RICAUX_COMPONENTS]"
-echo "Helm Release Name: $RELEASE_NAME"
-
-
-for component in $RICAUX_COMPONENTS; do
-  helm delete --purge  "${RELEASE_NAME}-${component}" 
 done
diff --git a/ric-infra/20-Monitoring/etc/elfkp.conf b/ric-infra/20-Monitoring/etc/elfkp.conf
deleted file mode 100644 (file)
index 92008b5..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-################################################################################
-#   Copyright (c) 2019 AT&T Intellectual Property.                             #
-#   Copyright (c) 2019 Nokia.                                                  #
-#                                                                              #
-#   Licensed under the Apache License, Version 2.0 (the "License");            #
-#   you may not use this file except in compliance with the License.           #
-#   You may obtain a copy of the License at                                    #
-#                                                                              #
-#       http://www.apache.org/licenses/LICENSE-2.0                             #
-#                                                                              #
-#   Unless required by applicable law or agreed to in writing, software        #
-#   distributed under the License is distributed on an "AS IS" BASIS,          #
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
-#   See the License for the specific language governing permissions and        #
-#   limitations under the License.                                             #
-################################################################################
-
-
-# helm_release_name defines the release name helm will use to deploy RIC
-# It will be overrided by RICPLT_RELEASE_NAME
-helm_release_name=r1
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICPLT_NAMESPACE
-plt_namespace=ricplt
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICXAPP_NAMESPACE
-xapp_namespace=ricxapp
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICAUX_NAMESPACE
-aux_namespace=ricaux
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICINFRA_NAMESPACE
-infra_namespace=ricinfra
index db2ccda..19eaf5d 100755 (executable)
 ################################################################################
 
 
-OVERRIDEYAML=$1
+while [ -n "$1" ]; do # while loop starts
 
+    case "$1" in
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
-
-source $DIR/../etc/kong.conf
+    -f) OVERRIDEYAML=$2
+        shift
+        ;;
+    -c) LIST_OF_COMPONENTS=$2
+        shift
+        ;;
+    *) echo "Option $1 not recognized" ;; # In case you typed a different option other than a,b,c
 
-if [ -z "$RICINFRA_RELEASE_NAME" ];then
-   RELEASE_NAME=$helm_release_name
-else
-   RELEASE_NAME=$RICINFRA_RELEASE_NAME
-fi
-# Namespace configuration
-if [ -z "$RICPLT_NAMESPACE" ];then
-   PLT_NAMESPACE=$plt_namespace
-else
-   PLT_NAMESPACE=$RICPLT_NAMESPACE
-fi
-if [ -z "$RICXAPP_NAMESPACE" ];then
-   XAPP_NAMESPACE=$xapp_namespace
-else
-   XAPP_NAMESPACE=$RICXAPP_NAMESPACE
-fi
-if [ -z "$RICAUX_NAMESPACE" ];then
-   AUX_NAMESPACE=$aux_namespace
-else
-   AUX_NAMESPACE=$RICAUX_NAMESPACE
-fi
-if [ -z "$RICINFRA_NAMESPACE" ];then
-   INFRA_NAMESPACE=$infra_namespace
-else
-   INFRA_NAMESPACE=$RICINFRA_NAMESPACE
-fi
+    esac
 
-if [ -z "$RIC_COMMON_OVERRIDE" ];then
-   COMMON_OVERRIDE="--set global.namespace.platform=$PLT_NAMESPACE --set global.namespace.xapp=$XAPP_NAMESPACE --set global.namespace.aux=$AUX_NAMESPACE --set global.namespace.infra=$INFRA_NAMESPACE"
-else
-   COMMON_OVERRIDE=$RIC_COMMON_OVERRIDE
-fi
+    shift
 
+done
 
 
+if [ -z "$OVERRIDEYAML" ];then
+    echo "****************************************************************************************************************"
+    echo "                                                     ERROR                                                      "
+    echo "****************************************************************************************************************"
+    echo "RIC deployment without deployment recipe is currently disabled. Please specify an recipe with the -f option."
+    echo "****************************************************************************************************************"
+    exit 1
+fi
 
-RICINFRA_COMPONENTS="kong"
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+GLOBAL_BLOCK=$(cat $OVERRIDEYAML | awk '/^global:/{getline; while ($0 ~ /^ +.*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE_BLOCK=$(cat $OVERRIDEYAML | awk '/^  namespace:/{getline; while ($0 ~ /^    .*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *infra:/{print $2}')
+RELEASE_PREFIX=$(echo "$GLOBAL_BLOCK" | awk '/^ *releasePrefix:/{print $2}')
+COMPONENTS=${LIST_OF_COMPONENTS:-"kong"}
 
-echo "Deploying RIC infra components [$RICINFRA_COMPONENTS]"
-echo "Helm Release Name: $RELEASE_NAME"
+echo "Deploying RIC infra components [$COMPONENTS]"
 
 
 COMMON_CHART_VERSION=$(cat $DIR/../../../ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}')
 helm package -d /tmp $DIR/../../../ric-common/Common-Template/helm/ric-common
 
 
-
-for component in $RICINFRA_COMPONENTS; do
+for component in $COMPONENTS; do
 
   mkdir -p $DIR/../helm/$component/charts/
-
   cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/$component/charts/
-
-  if [ -z $OVERRIDEYAML ]; then
-    helm install --debug --namespace "${INFRA_NAMESPACE}" --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component
-  else
-    helm install -f $OVERRIDEYAML --namespace "${INFRA_NAMESPACE}" --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component
-  fi
+  helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_PREFIX}-$component" $DIR/../helm/$component
 done
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
 
-
diff --git a/ric-infra/30-Kong/etc/kong.conf b/ric-infra/30-Kong/etc/kong.conf
deleted file mode 100644 (file)
index 92008b5..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-################################################################################
-#   Copyright (c) 2019 AT&T Intellectual Property.                             #
-#   Copyright (c) 2019 Nokia.                                                  #
-#                                                                              #
-#   Licensed under the Apache License, Version 2.0 (the "License");            #
-#   you may not use this file except in compliance with the License.           #
-#   You may obtain a copy of the License at                                    #
-#                                                                              #
-#       http://www.apache.org/licenses/LICENSE-2.0                             #
-#                                                                              #
-#   Unless required by applicable law or agreed to in writing, software        #
-#   distributed under the License is distributed on an "AS IS" BASIS,          #
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
-#   See the License for the specific language governing permissions and        #
-#   limitations under the License.                                             #
-################################################################################
-
-
-# helm_release_name defines the release name helm will use to deploy RIC
-# It will be overrided by RICPLT_RELEASE_NAME
-helm_release_name=r1
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICPLT_NAMESPACE
-plt_namespace=ricplt
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICXAPP_NAMESPACE
-xapp_namespace=ricxapp
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICAUX_NAMESPACE
-aux_namespace=ricaux
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICINFRA_NAMESPACE
-infra_namespace=ricinfra
index af9a258..a8ed393 100755 (executable)
 #   limitations under the License.                                             #
 ################################################################################
 
+while [ -n "$1" ]; do # while loop starts
 
-OVERRIDEYAML=$1
+    case "$1" in
 
+    -f) OVERRIDEYAML=$2
+        shift
+        ;;
+    -c) LIST_OF_COMPONENTS=$2
+        shift
+        ;;
+    *) echo "Option $1 not recognized" ;; # In case you typed a different option other than a,b,c
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+    esac
 
+    shift
 
-source $DIR/../etc/credential.conf
+done
 
-if [ -z "$RICINFRA_RELEASE_NAME" ];then
-   RELEASE_NAME=$helm_release_name
-else
-   RELEASE_NAME=$RICINFRA_RELEASE_NAME
-fi
-# Namespace configuration
-if [ -z "$RICPLT_NAMESPACE" ];then
-   PLT_NAMESPACE=$plt_namespace
-else
-   PLT_NAMESPACE=$RICPLT_NAMESPACE
-fi
-if [ -z "$RICXAPP_NAMESPACE" ];then
-   XAPP_NAMESPACE=$xapp_namespace
-else
-   XAPP_NAMESPACE=$RICXAPP_NAMESPACE
-fi
-if [ -z "$RICAUX_NAMESPACE" ];then
-   AUX_NAMESPACE=$aux_namespace
-else
-   AUX_NAMESPACE=$RICAUX_NAMESPACE
-fi
-if [ -z "$RICINFRA_NAMESPACE" ];then
-   INFRA_NAMESPACE=$infra_namespace
-else
-   INFRA_NAMESPACE=$RICINFRA_NAMESPACE
-fi
 
-if [ -z "$RIC_COMMON_OVERRIDE" ];then
-   COMMON_OVERRIDE="--set global.namespace.platform=$PLT_NAMESPACE --set global.namespace.xapp=$XAPP_NAMESPACE --set global.namespace.aux=$AUX_NAMESPACE --set global.namespace.infra=$INFRA_NAMESPACE"
-else
-   COMMON_OVERRIDE=$RIC_COMMON_OVERRIDE
+if [ -z "$OVERRIDEYAML" ];then
+    echo "****************************************************************************************************************"
+    echo "                                                     ERROR                                                      "
+    echo "****************************************************************************************************************"
+    echo "RIC deployment without deployment recipe is currently disabled. Please specify an recipe with the -f option."
+    echo "****************************************************************************************************************"
+    exit 1
 fi
 
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+GLOBAL_BLOCK=$(cat $OVERRIDEYAML | awk '/^global:/{getline; while ($0 ~ /^ +.*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE_BLOCK=$(cat $OVERRIDEYAML | awk '/^  namespace:/{getline; while ($0 ~ /^    .*|^ *$/) {print $0; if (getline == 0) {break}}}')
+INFRA_NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *infra:/{print $2}')
+AUX_NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *aux:/{print $2}')
+XAPP_NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *xapp:/{print $2}')
+PLT_NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *platform:/{print $2}')
+RELEASE_PREFIX=$(echo "$GLOBAL_BLOCK" | awk '/^ *releasePrefix:/{print $2}')
+COMPONENTS=${LIST_OF_COMPONENTS:-"credential"}
+
+echo "Deploying RIC infra components [$COMPONENTS]"
+
 COMMON_CHART_VERSION=$(cat $DIR/../../../ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}')
 helm package -d /tmp $DIR/../../../ric-common/Common-Template/helm/ric-common
 
 
-mkdir -p  $DIR/../helm/credential/charts/
-cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/credential/charts/
+for component in $COMPONENTS; do
 
-
-if [ -z $OVERRIDEYAML ]; then
-  helm install --namespace "${PLT_NAMESPACE}" --name "${RELEASE_NAME}-${PLT_NAMESPACE}-credential" $COMMON_OVERRIDE $DIR/../helm/credential
-  helm install --namespace "${XAPP_NAMESPACE}" --name "${RELEASE_NAME}-${XAPP_NAMESPACE}-credential" $COMMON_OVERRIDE $DIR/../helm/credential
-  helm install --namespace "${AUX_NAMESPACE}" --name "${RELEASE_NAME}-${AUX_NAMESPACE}-credential" $COMMON_OVERRIDE $DIR/../helm/credential
-  helm install --namespace "${INFRA_NAMESPACE}" --name "${RELEASE_NAME}-${INFRA_NAMESPACE}-credential" $COMMON_OVERRIDE $DIR/../helm/credential
-else
-  helm install -f $OVERRIDEYAML --namespace "${PLT_NAMESPACE}" --name "${RELEASE_NAME}-${PLT_NAMESPACE}-credential" $COMMON_OVERRIDE $DIR/../helm/credential
-  helm install -f $OVERRIDEYAML --namespace "${XAPP_NAMESPACE}" --name "${RELEASE_NAME}-${XAPP_NAMESPACE}-credential" $COMMON_OVERRIDE $DIR/../helm/credential
-  helm install -f $OVERRIDEYAML --namespace "${AUX_NAMESPACE}" --name "${RELEASE_NAME}-${AUX_NAMESPACE}-credential" $COMMON_OVERRIDE $DIR/../helm/credential
-  helm install -f $OVERRIDEYAML --namespace "${INFRA_NAMESPACE}" --name "${RELEASE_NAME}-${INFRA_NAMESPACE}-credential" $COMMON_OVERRIDE $DIR/../helm/credential
-fi
+  mkdir -p $DIR/../helm/$component/charts/
+  cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/$component/charts/
+  helm install -f $OVERRIDEYAML --namespace "${PLT_NAMESPACE}" --name "${RELEASE_PREFIX}-${PLT_NAMESPACE}-credential" $DIR/../helm/$component
+  helm install -f $OVERRIDEYAML --namespace "${XAPP_NAMESPACE}" --name "${RELEASE_PREFIX}-${XAPP_NAMESPACE}-credential" $DIR/../helm/$component
+  helm install -f $OVERRIDEYAML --namespace "${AUX_NAMESPACE}" --name "${RELEASE_PREFIX}-${AUX_NAMESPACE}-credential" $DIR/../helm/$component
+  helm install -f $OVERRIDEYAML --namespace "${INFRA_NAMESPACE}" --name "${RELEASE_PREFIX}-${INFRA_NAMESPACE}-credential" $DIR/../helm/$component
+done
 
index e112c06..c45136f 100755 (executable)
 ################################################################################
 
 
-OVERRIDEYAML=$1
+COMPONENTS="credential"
 
+echo "Undeploying RIC infra components [$COMPONENTS]"
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
-
-
-source $DIR/../etc/credential.conf
-
-if [ -z "$RICINFRA_RELEASE_NAME" ];then
-   RELEASE_NAME=$helm_release_name
-else
-   RELEASE_NAME=$RICINFRA_RELEASE_NAME
-fi
-
-# Namespace configuration
-if [ -z "$RICPLT_NAMESPACE" ];then
-   PLT_NAMESPACE=$plt_namespace
-else
-   PLT_NAMESPACE=$RICPLT_NAMESPACE
-fi
-if [ -z "$RICXAPP_NAMESPACE" ];then
-   XAPP_NAMESPACE=$xapp_namespace
-else
-   XAPP_NAMESPACE=$RICXAPP_NAMESPACE
-fi
-if [ -z "$RICAUX_NAMESPACE" ];then
-   AUX_NAMESPACE=$aux_namespace
-else
-   AUX_NAMESPACE=$RICAUX_NAMESPACE
-fi
-if [ -z "$RICINFRA_NAMESPACE" ];then
-   INFRA_NAMESPACE=$infra_namespace
-else
-   INFRA_NAMESPACE=$RICINFRA_NAMESPACE
-fi
-
-helm delete --purge "${RELEASE_NAME}-${PLT_NAMESPACE}-credential"
-helm delete --purge "${RELEASE_NAME}-${XAPP_NAMESPACE}-credential"
-helm delete --purge "${RELEASE_NAME}-${AUX_NAMESPACE}-credential"
-helm delete --purge "${RELEASE_NAME}-${INFRA_NAMESPACE}-credential"
 
+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
 
+done
diff --git a/ric-infra/40-Credential/etc/credential.conf b/ric-infra/40-Credential/etc/credential.conf
deleted file mode 100644 (file)
index 92008b5..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-################################################################################
-#   Copyright (c) 2019 AT&T Intellectual Property.                             #
-#   Copyright (c) 2019 Nokia.                                                  #
-#                                                                              #
-#   Licensed under the Apache License, Version 2.0 (the "License");            #
-#   you may not use this file except in compliance with the License.           #
-#   You may obtain a copy of the License at                                    #
-#                                                                              #
-#       http://www.apache.org/licenses/LICENSE-2.0                             #
-#                                                                              #
-#   Unless required by applicable law or agreed to in writing, software        #
-#   distributed under the License is distributed on an "AS IS" BASIS,          #
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
-#   See the License for the specific language governing permissions and        #
-#   limitations under the License.                                             #
-################################################################################
-
-
-# helm_release_name defines the release name helm will use to deploy RIC
-# It will be overrided by RICPLT_RELEASE_NAME
-helm_release_name=r1
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICPLT_NAMESPACE
-plt_namespace=ricplt
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICXAPP_NAMESPACE
-xapp_namespace=ricxapp
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICAUX_NAMESPACE
-aux_namespace=ricaux
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICINFRA_NAMESPACE
-infra_namespace=ricinfra
index 74313b1..caecdd9 100755 (executable)
 #   See the License for the specific language governing permissions and        #
 #   limitations under the License.                                             #
 ################################################################################
-OVERRIDEYAML=$1
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
-source $DIR/../etc/tiller.conf
 
-if [ -z "$RICINFRA_RELEASE_NAME" ];then
-    RELEASE_NAME=$helm_release_name
-else
-    RELEASE_NAME=$RICINFRA_RELEASE_NAME
-fi
+while [ -n "$1" ]; do # while loop starts
 
-# Namespace configuration
-if [ -z "$RICPLT_NAMESPACE" ];then
-    PLT_NAMESPACE=$plt_namespace
-else
-    PLT_NAMESPACE=$RICPLT_NAMESPACE
-fi
+    case "$1" in
 
-if [ -z "$RICXAPP_NAMESPACE" ];then
-    XAPP_NAMESPACE=$xapp_namespace
-else
-    XAPP_NAMESPACE=$RICXAPP_NAMESPACE
-fi
+    -f) OVERRIDEYAML=$2
+        shift
+        ;;
+    -c) LIST_OF_COMPONENTS=$2
+        shift
+        ;;
+    *) echo "Option $1 not recognized" ;; # In case you typed a different option other than a,b,c
 
-if [ -z "$RICAUX_NAMESPACE" ];then
-    AUX_NAMESPACE=$aux_namespace
-else
-    AUX_NAMESPACE=$RICAUX_NAMESPACE
-fi
+    esac
 
-if [ -z "$RICINFRA_NAMESPACE" ];then
-    INFRA_NAMESPACE=$infra_namespace
-else
-    INFRA_NAMESPACE=$RICINFRA_NAMESPACE
-fi
+    shift
 
-if [ -z "$RIC_COMMON_OVERRIDE" ];then
-    COMMON_OVERRIDE="--set global.namespace.platform=$PLT_NAMESPACE --set global.namespace.xapp=$XAPP_NAMESPACE --set global.namespace.aux=$AUX_NAMESPACE --set global.namespace.infra=$INFRA_NAMESPACE"
-else
-    COMMON_OVERRIDE=$RIC_COMMON_OVERRIDE
-fi
+done
 
 
-RICINFRA_COMPONENTS="xapp-tiller"
+if [ -z "$OVERRIDEYAML" ];then
+    echo "****************************************************************************************************************"
+    echo "                                                     ERROR                                                      "
+    echo "****************************************************************************************************************"
+    echo "RIC deployment without deployment recipe is currently disabled. Please specify an recipe with the -f option."
+    echo "****************************************************************************************************************"
+    exit 1
+fi
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+GLOBAL_BLOCK=$(cat $OVERRIDEYAML | awk '/^global:/{getline; while ($0 ~ /^ +.*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE_BLOCK=$(cat $OVERRIDEYAML | awk '/^  namespace:/{getline; while ($0 ~ /^    .*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *infra:/{print $2}')
+RELEASE_PREFIX=$(echo "$GLOBAL_BLOCK" | awk '/^ *releasePrefix:/{print $2}')
+COMPONENTS=${LIST_OF_COMPONENTS:-"xapp-tiller"}
 
-echo "Deploying RIC infra components [$RICINFRA_COMPONENTS]"
-echo "Helm Release Name: $RELEASE_NAME"
+echo "Deploying RIC infra components [$COMPONENTS]"
 
 
 COMMON_CHART_VERSION=$(cat $DIR/../../../ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}')
 helm package -d /tmp $DIR/../../../ric-common/Common-Template/helm/ric-common
 
 
-
-for component in $RICINFRA_COMPONENTS; do
+for component in $COMPONENTS; do
 
   mkdir -p $DIR/../helm/$component/charts/
-
   cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/$component/charts/
-
-  if [ -z $OVERRIDEYAML ]; then
-
-    EMPTY_CHART=$(helm template $DIR/../helm/$component | grep apiVersion:)
-    if [ ! -z "$EMPTY_CHART" ]; then
-      helm install --debug --namespace "${INFRA_NAMESPACE}" --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component
-    fi
-  else
-    EMPTY_CHART=$(helm template -f $OVERRIDEYAML $DIR/../helm/$component | grep apiVersion:)
-    if [ ! -z "$EMPTY_CHART" ]; then
-      helm install -f $OVERRIDEYAML --namespace "${INFRA_NAMESPACE}" --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component
-    fi
+  EMPTY_CHART=$(helm template -f $OVERRIDEYAML $DIR/../helm/$component | grep apiVersion:)
+  if [ ! -z "$EMPTY_CHART" ]; then
+    helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_PREFIX}-$component" $DIR/../helm/$component
   fi
 done
index 450e25c..8045ef8 100755 (executable)
 ################################################################################
 
 
+COMPONENTS="xapp-tiller"
+
+echo "Undeploying RIC infra components [$COMPONENTS]"
+for component in $COMPONENTS; do
+    RELEASE_LIST=$(helm list | grep "$component" | awk '{print $1}')
+    if [ ! -z "$RELEASE_LIST" ];then
+        NAMESPACE=$(helm list | grep "$component" | awk 'END{print $11}')
+       helm delete --purge $RELEASE_LIST
+
+        SECRET_LIST=$(kubectl get secret -n $NAMESPACE | awk '{ if ($2=="Opaque"){ print $1}}')
+        
+        for component in $SECRET_LIST; do
+          kubectl delete secret -n $NAMESPACE $component
+        done
+    fi
 
-
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
-
-
-source $DIR/../etc/tiller.conf
-
-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="xapp-tiller"
-
-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
 
-
-# We need to manually delete the secret creates by the secret container
-SECRET_LIST=$(kubectl get secret -n ricinfra | awk '{ if ($2=="Opaque"){ print $1}}')
-
-for component in $SECRET_LIST; do
-  kubectl delete secret -n $INFRA_NAMESPACE $component
-done
diff --git a/ric-infra/45-Tiller/etc/tiller.conf b/ric-infra/45-Tiller/etc/tiller.conf
deleted file mode 100644 (file)
index 92008b5..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-################################################################################
-#   Copyright (c) 2019 AT&T Intellectual Property.                             #
-#   Copyright (c) 2019 Nokia.                                                  #
-#                                                                              #
-#   Licensed under the Apache License, Version 2.0 (the "License");            #
-#   you may not use this file except in compliance with the License.           #
-#   You may obtain a copy of the License at                                    #
-#                                                                              #
-#       http://www.apache.org/licenses/LICENSE-2.0                             #
-#                                                                              #
-#   Unless required by applicable law or agreed to in writing, software        #
-#   distributed under the License is distributed on an "AS IS" BASIS,          #
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
-#   See the License for the specific language governing permissions and        #
-#   limitations under the License.                                             #
-################################################################################
-
-
-# helm_release_name defines the release name helm will use to deploy RIC
-# It will be overrided by RICPLT_RELEASE_NAME
-helm_release_name=r1
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICPLT_NAMESPACE
-plt_namespace=ricplt
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICXAPP_NAMESPACE
-xapp_namespace=ricxapp
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICAUX_NAMESPACE
-aux_namespace=ricaux
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICINFRA_NAMESPACE
-infra_namespace=ricinfra
index c14781a..83c7182 100755 (executable)
 #   See the License for the specific language governing permissions and        #
 #   limitations under the License.                                             #
 ################################################################################
+while [ -n "$1" ]; do # while loop starts
 
+    case "$1" in
 
-OVERRIDEYAML=$1
+    -f) OVERRIDEYAML=$2
+        shift
+        ;;
+    -c) LIST_OF_COMPONENTS=$2
+        shift
+        ;;
+    *) echo "Option $1 not recognized" ;; # In case you typed a different option other than a,b,c
 
+    esac
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
-
+    shift
 
-source $DIR/../etc/ric.conf
+done
 
-if [ -z "$RICPLT_RELEASE_NAME" ];then
-   RELEASE_NAME=$helm_release_name
-else
-   RELEASE_NAME=$RICPLT_RELEASE_NAME
-fi
 
-# Namespace configuration
-if [ -z "$RICPLT_NAMESPACE" ];then
-   PLT_NAMESPACE=$plt_namespace
-else
-   PLT_NAMESPACE=$RICPLT_NAMESPACE
-fi
-if [ -z "$RICXAPP_NAMESPACE" ];then
-   XAPP_NAMESPACE=$xapp_namespace
-else
-   XAPP_NAMESPACE=$RICXAPP_NAMESPACE
-fi
-if [ -z "$RICAUX_NAMESPACE" ];then
-   AUX_NAMESPACE=$aux_namespace
-else
-   AUX_NAMESPACE=$RICAUX_NAMESPACE
-fi
-if [ -z "$RICINFRA_NAMESPACE" ];then
-   INFRA_NAMESPACE=$infra_namespace
-else
-   INFRA_NAMESPACE=$RICINFRA_NAMESPACE
+if [ -z "$OVERRIDEYAML" ];then
+    echo "****************************************************************************************************************"
+    echo "                                                     ERROR                                                      "
+    echo "****************************************************************************************************************"
+    echo "RIC deployment without deployment recipe is currently disabled. Please specify an recipe with the -f option."
+    echo "****************************************************************************************************************"
+    exit 1
 fi
 
-if [ -z "$RIC_COMMON_OVERRIDE" ];then
-   COMMON_OVERRIDE="--set global.namespace.platform=$PLT_NAMESPACE --set global.namespace.xapp=$XAPP_NAMESPACE --set global.namespace.aux=$AUX_NAMESPACE --set global.namespace.infra=$INFRA_NAMESPACE"
-else
-   COMMON_OVERRIDE=$RIC_COMMON_OVERRIDE
-fi
-
-
-RICPLT_COMPONENTS="appmgr rtmgr dbaas e2mgr e2term a1mediator submgr vespamgr"
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+GLOBAL_BLOCK=$(cat $OVERRIDEYAML | awk '/^global:/{getline; while ($0 ~ /^ +.*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE_BLOCK=$(cat $OVERRIDEYAML | awk '/^  namespace:/{getline; while ($0 ~ /^    .*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *platform:/{print $2}')
+RELEASE_PREFIX=$(echo "$GLOBAL_BLOCK" | awk '/^ *releasePrefix:/{print $2}')
+COMPONENTS=${LIST_OF_COMPONENTS:-"appmgr rtmgr dbaas e2mgr e2term a1mediator submgr vespamgr"}
 
-echo "Deploying RIC Platform components [$RICPLT_COMPONENTS]"
-echo "Helm Release Name: $RELEASE_NAME"
+echo "Deploying RIC infra components [$COMPONENTS]"
 
 
 COMMON_CHART_VERSION=$(cat $DIR/../../../ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}')
-
-
 helm package -d /tmp $DIR/../../../ric-common/Common-Template/helm/ric-common
 
 
-for component in $RICPLT_COMPONENTS; do
-  echo "Preparing chart for comonent $component"
+for component in $COMPONENTS; do
 
-     
   mkdir -p $DIR/../helm/$component/charts/
   cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/$component/charts/
-  if [ -z $OVERRIDEYAML ]; then
-  helm install --namespace "${PLT_NAMESPACE}" --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component
-  else
-  helm install -f $OVERRIDEYAML --namespace "${PLT_NAMESPACE}" --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component
-  fi
+  helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_PREFIX}-$component" $DIR/../helm/$component
 done
index 21a8e3f..f991eac 100755 (executable)
 #   limitations under the License.                                             #
 ################################################################################
 
+COMPONENTS="appmgr rtmgr dbaas e2mgr e2term a1mediator submgr vespamgr"
 
+echo "Undeploying RIC platform components [$COMPONENTS]"
 
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
 
+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
 
-source $DIR/../etc/ric.conf
-
-if [ -z "$RICPLT_RELEASE_NAME" ];then
-   RELEASE_NAME=$helm_release_name
-else
-   RELEASE_NAME=$RICPLT_RELEASE_NAME
-fi
-
-RICPLT_COMPONENTS="appmgr rtmgr dbaas e2mgr e2term a1mediator submgr vespamgr"
-
-
-echo "Undeploying RIC Platform components [$RICPLT_COMPONENTS]"
-echo "Helm Release Name: $RELEASE_NAME"
-
-
-
-
-for component in $RICPLT_COMPONENTS; do
-  helm delete --purge "${RELEASE_NAME}-$component"
 done
diff --git a/ric-platform/50-RIC-Platform/etc/ric.conf b/ric-platform/50-RIC-Platform/etc/ric.conf
deleted file mode 100644 (file)
index 92008b5..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-################################################################################
-#   Copyright (c) 2019 AT&T Intellectual Property.                             #
-#   Copyright (c) 2019 Nokia.                                                  #
-#                                                                              #
-#   Licensed under the Apache License, Version 2.0 (the "License");            #
-#   you may not use this file except in compliance with the License.           #
-#   You may obtain a copy of the License at                                    #
-#                                                                              #
-#       http://www.apache.org/licenses/LICENSE-2.0                             #
-#                                                                              #
-#   Unless required by applicable law or agreed to in writing, software        #
-#   distributed under the License is distributed on an "AS IS" BASIS,          #
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
-#   See the License for the specific language governing permissions and        #
-#   limitations under the License.                                             #
-################################################################################
-
-
-# helm_release_name defines the release name helm will use to deploy RIC
-# It will be overrided by RICPLT_RELEASE_NAME
-helm_release_name=r1
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICPLT_NAMESPACE
-plt_namespace=ricplt
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICXAPP_NAMESPACE
-xapp_namespace=ricxapp
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICAUX_NAMESPACE
-aux_namespace=ricaux
-
-# namespace defines the namespace that helm will use to deploy RIC
-# It will be overrided by RICINFRA_NAMESPACE
-infra_namespace=ricinfra
index e6fd714..aa97b28 100755 (executable)
 #   See the License for the specific language governing permissions and        #
 #   limitations under the License.                                             #
 ################################################################################
+while [ -n "$1" ]; do # while loop starts
 
+    case "$1" in
 
-OVERRIDEYAML=$1
+    -f) OVERRIDEYAML=$2
+        shift
+        ;;
+    -c) LIST_OF_COMPONENTS=$2
+        shift
+        ;;
+    *) echo "Option $1 not recognized" ;; # In case you typed a different option other than a,b,c
 
+    esac
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
-
-source $DIR/../etc/ext.conf
+    shift
 
-if [ -z "$RICPLT_RELEASE_NAME" ];then
-   RELEASE_NAME=$helm_release_name
-else
-   RELEASE_NAME=$RICPLT_RELEASE_NAME
-fi
-# Namespace configuration
-if [ -z "$RICPLT_NAMESPACE" ];then
-   PLT_NAMESPACE=$plt_namespace
-else
-   PLT_NAMESPACE=$RICPLT_NAMESPACE
-fi
-if [ -z "$RICXAPP_NAMESPACE" ];then
-   XAPP_NAMESPACE=$xapp_namespace
-else
-   XAPP_NAMESPACE=$RICXAPP_NAMESPACE
-fi
-if [ -z "$RICAUX_NAMESPACE" ];then
-   AUX_NAMESPACE=$aux_namespace
-else
-   AUX_NAMESPACE=$RICAUX_NAMESPACE
-fi
-if [ -z "$RICINFRA_NAMESPACE" ];then
-   INFRA_NAMESPACE=$infra_namespace
-else
-   INFRA_NAMESPACE=$RICINFRA_NAMESPACE
-fi
+done
 
 
-if [ -z "$RIC_COMMON_OVERRIDE" ];then
-   COMMON_OVERRIDE="--set global.namespace.platform=$PLT_NAMESPACE --set global.namespace.xapp=$XAPP_NAMESPACE --set global.namespace.aux=$AUX_NAMESPACE --set global.namespace.infra=$INFRA_NAMESPACE"
-else
-   COMMON_OVERRIDE=$RIC_COMMON_OVERRIDE
+if [ -z "$OVERRIDEYAML" ];then
+    echo "****************************************************************************************************************"
+    echo "                                                     ERROR                                                      "
+    echo "****************************************************************************************************************"
+    echo "RIC deployment without deployment recipe is currently disabled. Please specify an recipe with the -f option."
+    echo "****************************************************************************************************************"
+    exit 1
 fi
 
-RICPLT_COMPONENTS="extsvcplt"
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+GLOBAL_BLOCK=$(cat $OVERRIDEYAML | awk '/^global:/{getline; while ($0 ~ /^ +.*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE_BLOCK=$(cat $OVERRIDEYAML | awk '/^  namespace:/{getline; while ($0 ~ /^    .*|^ *$/) {print $0; if (getline == 0) {break}}}')
+NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *platform:/{print $2}')
+RELEASE_PREFIX=$(echo "$GLOBAL_BLOCK" | awk '/^ *releasePrefix:/{print $2}')
+COMPONENTS=${LIST_OF_COMPONENTS:-"extsvcplt"}
 
-echo "Deploying RIC Platform components [$RICPLT_COMPONENTS]"
-echo "Helm Release Name: $RELEASE_NAME"
+echo "Deploying RIC infra components [$COMPONENTS]"
 
 
 COMMON_CHART_VERSION=$(cat $DIR/../../../ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}')
-
 helm package -d /tmp $DIR/../../../ric-common/Common-Template/helm/ric-common
 
 
-for component in $RICPLT_COMPONENTS; do
-  echo "Preparing chart for comonent $component"
+for component in $COMPONENTS; do
 
-  
-  mkdir -p  $DIR/../helm/$component/charts/
+  mkdir -p $DIR/../helm/$component/charts/
   cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/../helm/$component/charts/
-  if [ -z $OVERRIDEYAML ]; then
-  helm install --debug --namespace "${PLT_NAMESPACE}" --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component
-  else
-  helm install -f $OVERRIDEYAML --namespace "${PLT_NAMESPACE}" --name "${RELEASE_NAME}-$component" $COMMON_OVERRIDE $DIR/../helm/$component
-  fi
+  helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_PREFIX}-$component" $DIR/../helm/$component
 done
index 751c157..67db3a9 100755 (executable)
 
 
 
+COMPONENTS="extsvcplt"
 
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+echo "Undeploying RIC platform components [$COMPONENTS]"
 
 
-source $DIR/../etc/ext.conf
 
-if [ -z "$RICPLT_RELEASE_NAME" ];then
-   RELEASE_NAME=$helm_release_name
-else
-   RELEASE_NAME=$RICPLT_RELEASE_NAME
-fi
-if [ -z "$RICPLT_NAMESPACE" ];then
-   NAMESPACE=$namespace
-else
-   NAMESPACE=$RICPLT_NAMESPACE
-fi
+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
 
-RICPLT_COMPONENTS="extsvcplt"
-
-echo "Undeploying RIC Platform components [$RICPLT_COMPONENTS]"
-echo "Platform Namespace: $NAMESPACE"
-echo "Helm Release Name: $RELEASE_NAME"
-
-
-for component in $RICPLT_COMPONENTS; do
-  helm delete --purge  "${RELEASE_NAME}-$component" 
 done
+