# 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
# 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:
# 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
# Infrastructure
#-------------------------------------------------------------------------
-cluster:
- deployK8S: false
- deployNexus: false
- deployK8SMonitoringStack: false
- useLocalHelmRepo: true
- useLocalDockerRegistry: false
credential:
repositoryCredential:
<CERT FOR HELM>
-----END CERTIFICATE-----
+k8s:
+ enable: false
chartmuseum:
+ enable: false
repositoryOverride: "docker.io"
image:
name: chartmuseum/chartmuseum
image:
name: alpine
tag: latest
-
storagesize: 2Gi
+ datapath: /opt/data/chartmuseum-data
+
+elfkp:
+ enable: false
+
# 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
+++ /dev/null
-#!/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
# 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
# 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
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
# 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
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
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
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
+++ /dev/null
-################################################################################
-# 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
################################################################################
-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}')
fi
done
-if [ ! -z $OVERRIDEYAML ]; then
- FOUND_STORAGECLASS=$(grep storageclass $OVERRIDEYAML)
-fi
-
+FOUND_STORAGECLASS=$(grep storageclass $OVERRIDEYAML)
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}' )
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
################################################################################
+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
+++ /dev/null
-################################################################################
-# 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
# 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
# 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
+++ /dev/null
-################################################################################
-# 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
################################################################################
-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)
fi
done
-if [ ! -z $OVERRIDEYAML ]; then
- FOUND_STORAGECLASS=$(grep storageclass $OVERRIDEYAML)
-fi
-
-
+FOUND_STORAGECLASS=$(grep storageclass $OVERRIDEYAML)
if ! $LABELFOUND && [ -z "$FOUND_STORAGECLASS" ]; then
echo "***********************************************************************************************"
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}' )
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
# 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
+++ /dev/null
-################################################################################
-# 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
# 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 \
# --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
# 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
+++ /dev/null
-################################################################################
-# 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
################################################################################
-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
-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
-
+++ /dev/null
-################################################################################
-# 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
# 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
################################################################################
-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
+++ /dev/null
-################################################################################
-# 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
# 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
################################################################################
+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
+++ /dev/null
-################################################################################
-# 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
# 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
# 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
+++ /dev/null
-################################################################################
-# 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
# 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
+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
+