2 ################################################################################
3 # Copyright (c) 2019 AT&T Intellectual Property. #
4 # Copyright (c) 2019 Nokia. #
6 # Licensed under the Apache License, Version 2.0 (the "License"); #
7 # you may not use this file except in compliance with the License. #
8 # You may obtain a copy of the License at #
10 # http://www.apache.org/licenses/LICENSE-2.0 #
12 # Unless required by applicable law or agreed to in writing, software #
13 # distributed under the License is distributed on an "AS IS" BASIS, #
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
15 # See the License for the specific language governing permissions and #
16 # limitations under the License. #
17 ################################################################################
19 # This script deploys RIC platform components automatically
23 if [ -z "$OVERRIDEYAML" ];then
24 echo "****************************************************************************************************************"
26 echo "****************************************************************************************************************"
27 echo "Preparing the clusters for RIC deployment without deployment recipe. Default configurations are used."
28 echo "****************************************************************************************************************"
34 ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
36 source $ROOT_DIR/../etc/ric.conf
37 source $ROOT_DIR/../etc/ric-infra.conf
40 export RICINFRA_RELEASE_NAME=$helm_release_name
42 export RICPLT_NAMESPACE=$plt_namespace
43 export RICXAPP_NAMESPACE=$xapp_namespace
44 export RICAUX_NAMESPACE=$aux_namespace
45 export RICINFRA_NAMESPACE=$infra_namespace
48 if [ ! -z $OVERRIDEYAML ]; then
49 DEPLOY_K8S_FROM_OVERRIDE=$(cat $OVERRIDEYAML | grep deployK8S: | awk '{print $2}')
50 USE_LOCAL_HELM_REPO_FROM_OVERRIDE=$(cat $OVERRIDEYAML | grep useLocalHelmRepo: | awk '{print $2}')
51 USE_LOCAL_DOCKER_REGISTRY_FROM_OVERRIDE=$(cat $OVERRIDEYAML | grep useLocalDockerRegistry: | awk '{print $2}')
52 DEPLOY_K8S_MONITORING_FROM_OVERRIDE=$(cat $OVERRIDEYAML | grep deployK8SMonitoringStake: | awk '{print $2}')
55 if [ -z $DEPLOY_K8S_FROM_OVERRIDE ]; then
56 export DEPLOY_K8S=$deployK8S
58 export DEPLOY_K8S=$DEPLOY_K8S_FROM_OVERRIDE
61 if [ -z $USE_LOCAL_HELM_REPO_FROM_OVERRIDE ]; then
62 export USE_LOCAL_HELM_REPO=$useLocalHelmRepo
64 export USE_LOCAL_HELM_REPO=$USE_LOCAL_HELM_REPO_FROM_OVERRIDE
67 if [ -z $USE_LOCAL_DOCKER_REGISTRY_FROM_OVERRIDE ]; then
68 export USE_LOCAL_DOCKER_REGISTRY=$useLocalDockerRegistry
70 export USE_LOCAL_DOCKER_REGISTRY=$USE_LOCAL_DOCKER_REGISTRY_FROM_OVERRIDE
73 if [ -z $DEPLOY_K8S_MONITORING_FROM_OVERRIDE ]; then
74 export DEPLOY_K8S_MONITORING=$deployK8S
76 export DEPLOY_K8S_MONITORING=$DEPLOY_K8S_MONITORING_FROM_OVERRIDE
80 if ! $USE_LOCAL_HELM_REPO; then
81 echo "****************************************************************************************************************"
83 echo "****************************************************************************************************************"
84 echo "RIC will use an external helm repository. Please make sure that the certificate is included in the recipe file."
85 echo "****************************************************************************************************************"
89 if $USE_LOCAL_DOCKER_REGISTRY; then
90 echo "****************************************************************************************************************"
92 echo "****************************************************************************************************************"
93 echo "RIC will use an internal docker registry. You need to manually include the certificate to all servers in the cluster."
94 echo "****************************************************************************************************************"
99 for component in $ROOT_DIR/../ric-infra/*/; do
100 component_name=$(echo $component | awk '{n=split($0, temp,"/"); print temp[n-1];}')
102 case "$component_name" in
105 . $component/bin/install $OVERRIDEYAM
109 if $USE_LOCAL_DOCKER_REGISTRY; then
110 . $component/bin/install $OVERRIDEYAM
114 if $USE_LOCAL_HELM_REPO; then
115 . $component/bin/install $OVERRIDEYAM
119 if $DEPLOY_K8S_MONITORING; then
120 . $component/bin/install $OVERRIDEYAM
124 . $component/bin/install $OVERRIDEYAM