diff options
author | marekpl <marek.pondel@nokia.com> | 2019-08-02 18:11:42 +0200 |
---|---|---|
committer | marekpl <marek.pondel@nokia.com> | 2019-08-05 19:01:31 +0200 |
commit | 1b6baa471cd767eca4da6b44c645110c80987e4a (patch) | |
tree | d41fcddab88150995d640c263c5762a8afd1fe70 /demo-k8s.sh | |
parent | 1a6b1c4d7fbc360782e3f50de0be1dc868c62b51 (diff) |
hv-ves ete script added
hv-ves ete script added
Issue-ID: DCAEGEN2-1226
Signed-off-by: marekpl <marek.pondel@nokia.com>
Change-Id: I85f83152b305100d0f201dc8315865fdc598b1eb
Diffstat (limited to 'demo-k8s.sh')
-rwxr-xr-x | demo-k8s.sh | 25 |
1 files changed, 22 insertions, 3 deletions
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 <namespace> <command> [<parameters>]" + echo "Usage: demo-k8s.sh <namespace> <command> [<parameters>] [execscript]" echo " " echo " demo-k8s.sh <namespace> 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 <namespace> vfwclosedloop <pgn-ip-address>" - 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 <namespace> <command> [<parameters>] 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)) |