3 # ============LICENSE_START===============================================
4 # Copyright (C) 2023 Nordix Foundation. All rights reserved.
5 # ========================================================================
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 # ============LICENSE_END=================================================
20 . scripts/get_influxdb2_token.sh
21 . scripts/populate_keycloak.sh
24 echo "Usage: pmrapp-setup.sh"
37 echo "Cleaning previously started containers..."
42 export PMRAPP_IMAGE="pm-rapp:latest"
49 echo "Creating topic $TOPIC with retention $(($rt/1000)) seconds"
50 while [ $retcode -ne 0 ]; do
51 cmd_output=$(docker exec -it common-kafka-1-1 ./bin/kafka-topics.sh \
52 --create --topic $TOPIC --config retention.ms=$rt --bootstrap-server kafka-1:9092)
54 test_string="Topic 'rapp-topic' already exists"
55 if [[ $cmd_output == *${test_string}* ]]; then
66 create_clients nonrtric-realm $cid
68 generate_client_secrets nonrtric-realm $cid
71 export PMRAPP_CLIENT_SECRET=$(< .sec_nonrtric-realm_$cid)
72 envsubst < docker-compose-pmrapp.yaml > docker-compose-pmrapp_gen.yaml
73 docker-compose -p pmrapp -f docker-compose-pmrapp_gen.yaml up -d