blob: 97479d05a74a23d9ed4bf168de02ca25f200109a [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..."
33 sudo snap install yq --channel=v3/stable
34fi
35
36INSTALL_KONG=$(yq read "$OVERRIDEYAML" 'nonrtric.installKong')
37if [ $? -ne 0 ] || [ -z "$INSTALL_KONG" ]; then
38 echo "Error: failed to parse installKong from YAML with yq. Aborting install."
39 exit 1
40fi
41
42INSTALL_CAPIF=$(yq read "$OVERRIDEYAML" 'nonrtric.installCapifcore')
43if [ $? -ne 0 ] || [ -z "$INSTALL_CAPIF" ]; then
44 echo "Error: failed to parse installCapifcore from YAML with yq. Aborting install."
45 exit 1
46fi
47
48INSTALL_SERVICEMANAGER=$(yq read "$OVERRIDEYAML" 'nonrtric.installServicemanager')
49if [ $? -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"