blob: 4f58600e9d083494bcd7bc5c9b7a57995488f8ec [file] [log] [blame]
sebdeta2c2df52021-10-15 13:47:31 +02001#!/bin/bash
2
3###
DenisGNoonan3fdbdbb2024-05-16 10:49:21 +01004# ============LICENSE_START========================================================
sebdeta2c2df52021-10-15 13:47:31 +02005# ORAN SMO Package
DenisGNoonan3fdbdbb2024-05-16 10:49:21 +01006# =================================================================================
7# Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
8# Modification Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved.
9# =================================================================================
sebdeta2c2df52021-10-15 13:47:31 +020010# Licensed under the Apache License, Version 2.0 (the "License");
11# you may not use this file except in compliance with the License.
12# You may obtain a copy of the License at
13#
14# http://www.apache.org/licenses/LICENSE-2.0
15#
16# Unless required by applicable law or agreed to in writing, software
17# distributed under the License is distributed on an "AS IS" BASIS,
18# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19# See the License for the specific language governing permissions and
20# limitations under the License.
DenisGNoonan3fdbdbb2024-05-16 10:49:21 +010021# ============LICENSE_END==========================================================
22# =================================================================================
23#
sebdeta2c2df52021-10-15 13:47:31 +020024###
25
26kubectl create namespace nonrtric
27echo '### Installing ORAN NONRTRIC part ###'
DenisGNoonan3fdbdbb2024-05-16 10:49:21 +010028
29OVERRIDEYAML=$1
30
31if ! command -v yq > /dev/null 2>&1; then
32 echo "yq is not installed. Installing yq..."
aravind.est68332a42024-06-26 16:20:45 +010033 sudo snap install yq --channel=v4/stable
DenisGNoonan3fdbdbb2024-05-16 10:49:21 +010034fi
35
aravind.est68332a42024-06-26 16:20:45 +010036INSTALL_KONG=$(cat $OVERRIDEYAML | yq e '.nonrtric.installKong' -)
DenisGNoonan3fdbdbb2024-05-16 10:49:21 +010037if [ $? -ne 0 ] || [ -z "$INSTALL_KONG" ]; then
38 echo "Error: failed to parse installKong from YAML with yq. Aborting install."
39 exit 1
40fi
41
aravind.est68332a42024-06-26 16:20:45 +010042INSTALL_CAPIF=$(cat $OVERRIDEYAML | yq e '.nonrtric.installCapifcore' -)
DenisGNoonan3fdbdbb2024-05-16 10:49:21 +010043if [ $? -ne 0 ] || [ -z "$INSTALL_CAPIF" ]; then
44 echo "Error: failed to parse installCapifcore from YAML with yq. Aborting install."
45 exit 1
46fi
47
aravind.est68332a42024-06-26 16:20:45 +010048INSTALL_SERVICEMANAGER=$(cat $OVERRIDEYAML | yq e '.nonrtric.installServicemanager' -)
DenisGNoonan3fdbdbb2024-05-16 10:49:21 +010049if [ $? -ne 0 ] || [ -z "$INSTALL_SERVICEMANAGER" ]; then
50 echo "Error: failed to parse installServicemanager from YAML with yq. Aborting install."
51 exit 1
52fi
53
54if [ "$INSTALL_SERVICEMANAGER" == "true" ]; then
55 if [ "$INSTALL_KONG" == "false" ]; then
56 echo "Error: INSTALL_KONG must be true if INSTALL_SERVICEMANAGER is true. Aborting install."
57 exit 1
58 fi
59 if [ "$INSTALL_CAPIF" == "false" ]; then
60 echo "Error: INSTALL_CAPIF must be true if INSTALL_SERVICEMANAGER is true. Aborting install."
61 exit 1
62 fi
63fi
64
65helm install --debug oran-nonrtric local/nonrtric --namespace nonrtric -f $OVERRIDEYAML --set nonrtric.persistence.mountPath="/dockerdata-nfs/deployment-$2"
DenisGNoonan90438072024-08-14 12:38:47 +010066
67if [ "$INSTALL_SERVICEMANAGER" == "true" ]; then
68 pushd ../../../servicemanager-preload
69 # Send stderr to /dev/null to turn off chatty logging
70 ./servicemanager-preload.sh config-nonrtric.yaml 2>/dev/null
71 ./servicemanager-preload.sh config-smo.yaml 2>/dev/null
72 popd
73fi