From 1b6baa471cd767eca4da6b44c645110c80987e4a Mon Sep 17 00:00:00 2001 From: marekpl Date: Fri, 2 Aug 2019 18:11:42 +0200 Subject: hv-ves ete script added hv-ves ete script added Issue-ID: DCAEGEN2-1226 Signed-off-by: marekpl Change-Id: I85f83152b305100d0f201dc8315865fdc598b1eb --- demo-k8s.sh | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'demo-k8s.sh') diff --git a/demo-k8s.sh b/demo-k8s.sh index 9b98c87..3d6e9d0 100755 --- a/demo-k8s.sh +++ b/demo-k8s.sh @@ -18,7 +18,7 @@ # function usage { - echo "Usage: demo-k8s.sh []" + echo "Usage: demo-k8s.sh [] [execscript]" echo " " echo " demo-k8s.sh init" echo " - Execute both init_customer + distribute" @@ -52,11 +52,21 @@ function usage echo " - Run heatbridge against the stack for the given service instance and service" echo " " echo " demo-k8s.sh vfwclosedloop " - echo " - vFWCL: Sets the packet generator to high and low rates, and checks whether the policy " - echo " kicks in to modulate the rates back to medium" + echo " - vFWCL: Sets the packet generator to high and low rates, and checks whether the policy " + echo " kicks in to modulate the rates back to medium" + echo " " + echo " demo-k8s.sh [] execscript + echo " - Optional parameter to execute user custom scripts located in scripts/demoscript directory" echo " " } +# Check if execscript flag is used and drop it from input arguments + +if [[ "${!#}" == "execscript" ]]; then + set -- "${@:1:$#-1}" + execscript=true +fi + # Set the defaults echo "Number of parameters:" @@ -212,8 +222,17 @@ set -x POD=$(kubectl --namespace $NAMESPACE get pods | sed 's/ .*//'| grep robot) +DIR=$(dirname "$0") +SCRIPTDIR=scripts/demoscript + ETEHOME=/var/opt/ONAP +if [ $execscript ]; then + for script in $(ls -1 "$DIR/$SCRIPTDIR"); do + [ -f "$DIR/$SCRIPTDIR/$script" ] && [ -x "$DIR/$SCRIPTDIR/$script" ] && source "$DIR/$SCRIPTDIR/$script" + done +fi + export GLOBAL_BUILD_NUMBER=$(kubectl --namespace $NAMESPACE exec ${POD} -- bash -c "ls -1q /share/logs/ | wc -l") OUTPUT_FOLDER=$(printf %04d $GLOBAL_BUILD_NUMBER)_demo_$key DISPLAY_NUM=$(($GLOBAL_BUILD_NUMBER + 90)) -- cgit 1.2.3-korg