3 ################################################################################
4 # Copyright (c) 2019 AT&T Intellectual Property. #
5 # Copyright (c) 2019 Nokia. #
7 # Licensed under the Apache License, Version 2.0 (the "License"); #
8 # you may not use this file except in compliance with the License. #
9 # You may obtain a copy of the License at #
11 # http://www.apache.org/licenses/LICENSE-2.0 #
13 # Unless required by applicable law or agreed to in writing, software #
14 # distributed under the License is distributed on an "AS IS" BASIS, #
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
16 # See the License for the specific language governing permissions and #
17 # limitations under the License. #
18 ################################################################################
23 echo "Usage: demo.sh namespace <command> [<parameters>]"
25 echo " demo.sh <namespace> init_robot"
26 echo " - Initialize robot after all RIC VMs have started"
33 #echo "Number of parameters:"
42 POD=$(kubectl --namespace $NAMESPACE get pods -l robotImplementation=ric-robot --no-headers=true | sed 's/ .*//')
47 ## if more than 1 tag is supplied, the must be provided with -i or -e
59 VARIABLES="$VARIABLES -v WEB_PASSWORD:$WEB_PASSWORD"
62 VARIABLES="$VARIABLES -v HOSTS_PREFIX:$1"
64 # copy the .kube/config into the robot container
65 kubectl -n $NAMESPACE cp /root/.kube/config $POD:/root/.kube/config
79 export GLOBAL_BUILD_NUMBER=$(kubectl --namespace $NAMESPACE exec ${POD} -- bash -c "ls -1q /share/logs/ | wc -l")
80 OUTPUT_FOLDER=$(printf %04d $GLOBAL_BUILD_NUMBER)_demo_$key
81 DISPLAY_NUM=$(($GLOBAL_BUILD_NUMBER + 90))
83 VARIABLEFILES="-V /share/config/vm_properties.py -V /share/config/integration_robot_properties.py -V /share/config/integration_preload_parameters.py"
85 kubectl --namespace $NAMESPACE exec ${POD} -- ${ETEHOME}/runTags.sh ${VARIABLEFILES} ${VARIABLES} -d /share/logs/${OUTPUT_FOLDER} -i ${TAG} --display $DISPLAY_NUM 2> ${TAG}.out