X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=install%2Finstall-pm-rapp.sh;fp=install%2Finstall-pm-rapp.sh;h=37fb826d51a4a00c5649cc5f6cbadaedbf1e281d;hb=c5655db5780275b07b25b57b767808f2f1eac7d9;hp=0000000000000000000000000000000000000000;hpb=7c434fcb459c84543cdb0ad14aa59391c60d16d4;p=nonrtric%2Fplt%2Franpm.git diff --git a/install/install-pm-rapp.sh b/install/install-pm-rapp.sh new file mode 100755 index 0000000..37fb826 --- /dev/null +++ b/install/install-pm-rapp.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +# ============LICENSE_START=============================================== +# Copyright (C) 2023 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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. +# ============LICENSE_END================================================= +# + + + +echo "Installtion pmrapp" + +. scripts/kube_get_controlplane_host.sh +. scripts/kube_get_nodeport.sh +. scripts/create_topic.sh + +# Generic error printout function +# args: +check_error() { + if [ $1 -ne 0 ]; then + echo "Failed: $2" + echo "Exiting..." + exit 1 + fi +} + +echo "Creating client in keycloak" + +# Find host and port to keycloak +export KHOST=$(kube_get_controlplane_host) +if [ $? -ne 0 ]; then + echo $KHOST + echo "Exiting" + exit 1 +fi + +create_topic kafka-1-kafka-bootstrap.nonrtric:9092 pm-rapp 10 + +export KC_PORT=$(kube_get_nodeport keycloak nonrtric http) + +. scripts/populate_keycloak.sh + +cid="pm-rapp" +create_clients nonrtric-realm $cid +check_error $? +generate_client_secrets nonrtric-realm $cid +check_error $? + +export PMRAPP_CLIENT_SECRET=$(< .sec_nonrtric-realm_$cid) + +envsubst < helm/nrt-pm-rapp/values-template.yaml > helm/nrt-pm-rapp/values.yaml + +echo " helm install..." +helm install --wait -n nonrtric nrt-pm-rapp helm/nrt-pm-rapp + +echo "done" +