X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jenkins-scripts%2Fsystem_type.sh;h=c5b141afd47d859d9384915f0247f905c0bd2748;hb=05ac2c55032ba988df52a0c514915693ba5f5bfe;hp=201f34f9ae29bcbf1edc2ec9ffa754c496412b14;hpb=f16525004cf0d397b304fcdf58b0d2dedd9923e2;p=releng%2Fbuilder.git diff --git a/jenkins-scripts/system_type.sh b/jenkins-scripts/system_type.sh index 201f34f9a..c5b141afd 100755 --- a/jenkins-scripts/system_type.sh +++ b/jenkins-scripts/system_type.sh @@ -1,6 +1,5 @@ #!/bin/bash - -# @License EPL-1.0 +# SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2016 The Linux Foundation and others. # @@ -10,27 +9,21 @@ # http://www.eclipse.org/legal/epl-v10.html ############################################################################## -HOST=$(/usr/bin/hostname) +HOST=$(/bin/hostname) SYSTEM_TYPE='' -# We use a separator character of - for the slave parts -IFS='-' read -r -a HOSTPARTS <<< "${HOST}" - -# slurp in the control scripts -FILES=($(find . -maxdepth 1 -type f -iname '*.sh' -exec basename -s '.sh' {} \;)) -# remap into an associative array -declare -A A_FILES -for key in "${!FILES[@]}" -do - A_FILES[${FILES[$key]}]="${key}" -done - -# Find our system_type control script if possible -for i in "${HOSTPARTS[@]}" -do - if [ "${A_FILES[${i}]}" != "" ] - then - SYSTEM_TYPE=${i} +IFS=',' +for i in "java-builder,builder" \ + "builder,builder" \ + "devstack,devstack" \ + "docker,docker" \ + "gbp,ubuntu-docker-ovs" \ + "kubernetes,mininet-ubuntu" \ + "robot,robot" \ + "mininet,mininet-ubuntu" +do set -- $i + if [[ $HOST == *"$1"* ]]; then + SYSTEM_TYPE="$2" break fi done