Added docker-compose ranpm
[nonrtric/plt/ranpm.git] / docker-proj / scripts / push-to-file-ready-topic.sh
1 #!/bin/bash
2
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
9 #
10 #       http://www.apache.org/licenses/LICENSE-2.0
11 #
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=================================================
18 #
19 SD=$(dirname -- "$0")
20 echo "${0##*/} script-home: "$SD
21 cd $SD
22 CWD=$PWD
23
24
25 NODE_COUNT=$1
26 EVT_COUNT=$2
27 NODE_NAME_BASE=$3
28 FILE_EXT=$4
29 SRV_COUNT=$5
30
31 print_usage() {
32     echo "Usage: push-to-file-ready-topic.sh <node-count> <num-of-events> <node-name-base> <file-extension> <num-servers>"
33     exit 1
34 }
35 if [ $# -lt 5 ]; then
36     print_usage
37 fi
38
39 chmod +x kafka-client-send-file-ready.sh
40 docker cp kafka-client-send-file-ready.sh common-kafka-1-1:/tmp/
41
42 docker exec -it common-kafka-1-1 /tmp/kafka-client-send-file-ready.sh $NODE_COUNT $EVT_COUNT $NODE_NAME_BASE $FILE_EXT $SRV_COUNT
43
44 echo done
45