X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ric_robot_suite%2Fhelm%2Frobot_install.sh;fp=ric_robot_suite%2Fhelm%2Frobot_install.sh;h=92b7b93b79dc5f7cf28d54c66048813f2280fd1d;hb=c5fa07bcd8cbd614bcd813cac698385b789bcfcb;hp=0000000000000000000000000000000000000000;hpb=59f84608ec15c016958a6e0e0ddd813f376c0925;p=it%2Ftest.git diff --git a/ric_robot_suite/helm/robot_install.sh b/ric_robot_suite/helm/robot_install.sh new file mode 100755 index 0000000..92b7b93 --- /dev/null +++ b/ric_robot_suite/helm/robot_install.sh @@ -0,0 +1,76 @@ +#!/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. # +################################################################################ + + +OVERRIDEYAML=$1 + + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + +#/root/test/ric_robot_suite/helm +# extract the base to find root to dep + +BASE=${DIR%/test*} + +# /data/ORAN-OSC/it/dep/ric-platform/50-RIC-Platform/bin/install +BASEDIR50=$BASE/dep/ric-platform/50-RIC-Platform/ +BASEDIR_COMMON_TEMPLATE=$BASE/dep/ric-common/Common-Template/helm/ric-common + +echo "Using etc/ric.conf from $BASEDIR50" + +source $BASEDIR50/etc/ric.conf + + +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 + +RICPLT_COMPONENTS="ric-robot" + +echo "Deploying RIC Platform components [$RICPLT_COMPONENTS]" +echo "Platform Namespace: $PLT_NAMESPACE" +echo "Helm Release Name: $RELEASE_NAME" + + +COMMON_CHART_VERSION=$(cat $BASEDIR_COMMON_TEMPLATE/Chart.yaml | grep version | awk '{print $2}') + +helm package -d /tmp $BASEDIR_COMMON_TEMPLATE + + +for component in $RICPLT_COMPONENTS; do + echo "Preparing chart for comonent $component" + mkdir -p $DIR/$component/charts/ + cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $DIR/$component/charts/ + if [ -z $OVERRIDEYAML ]; then + echo "helm install --namespace \"${PLT_NAMESPACE}\" --set \"Release.HelmReleaseName=${RELEASE_NAME}\" --name \"${RELEASE_NAME}-$component\" $DIR/../helm/$component" + helm install --namespace "${PLT_NAMESPACE}" --set "Release.HelmReleaseName=${RELEASE_NAME}" --name "${RELEASE_NAME}-$component" $DIR/$component + else + echo "helm install -f $OVERRIDEYAML --namespace \"${PLT_NAMESPACE}\" --set \"Release.HelmReleaseName=${RELEASE_NAME}\" --name \"${RELEASE_NAME}-$component\" $DIR/../helm/$component" + helm install -f $OVERRIDEYAML --namespace "${PLT_NAMESPACE}" --set "Release.HelmReleaseName=${RELEASE_NAME}" --name "${RELEASE_NAME}-$component" $DIR/$component + fi +done +