X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=install%2Fscripts%2Fpush-genfiles-to-file-ready-topic.sh;fp=install%2Fscripts%2Fpush-genfiles-to-file-ready-topic.sh;h=574ae70541383888a7143240a17e737dfd457b74;hb=c5655db5780275b07b25b57b767808f2f1eac7d9;hp=0000000000000000000000000000000000000000;hpb=7c434fcb459c84543cdb0ad14aa59391c60d16d4;p=nonrtric%2Fplt%2Franpm.git diff --git a/install/scripts/push-genfiles-to-file-ready-topic.sh b/install/scripts/push-genfiles-to-file-ready-topic.sh new file mode 100755 index 0000000..574ae70 --- /dev/null +++ b/install/scripts/push-genfiles-to-file-ready-topic.sh @@ -0,0 +1,75 @@ +#!/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================================================= +# + +SD=$(dirname -- "$0") +echo "${0##*/} script-home: "$SD +cd $SD +CWD=$PWD + + +NODE_COUNT=$1 +EVT_COUNT=$2 +NODE_NAME_BASE=$3 +FILE_EXT=$4 +TYPE=$5 +SRV_COUNT=$6 +HIST=$7 + +print_usage() { + echo "Usage: push-genfiles-to-file-ready-topic.sh sftp|ftpes|https [hist]" + exit 1 +} +if [ $# -lt 6 ] || [ $# -gt 7 ]; then + print_usage +fi + +if [ $TYPE == "sftp" ]; then + echo "sftp servers not yet supported" +elif [ $TYPE == "ftpes" ]; then + echo "ftpes servers not yet supported" +elif [ $TYPE == "https" ]; then + : +else + print_usage +fi + +if [ $FILE_EXT != "xml.gz" ]; then + echo "only xml.gz format supported" + print_usage +fi + +if [ ! -z "$HIST" ]; then + if [ $HIST != "hist" ]; then + print_usage + fi +fi + +if [ "$KUBECONFIG" == "" ]; then + echo "Env var KUBECONFIG not set, using current settings for kubectl" +else + echo "Env var KUBECONFIG set to $KUBECONFIG" +fi + +chmod +x kafka-client-send-genfiles-file-ready.sh +kubectl cp kafka-client-send-genfiles-file-ready.sh nonrtric/client:/home/appuser + +kubectl exec client -n nonrtric -- bash -c './kafka-client-send-genfiles-file-ready.sh '$NODE_COUNT' '$EVT_COUNT' '$NODE_NAME_BASE' '$FILE_EXT' '$TYPE' '$SRV_COUNT' '$HIST + +echo done +