X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=jenkins-scripts%2Fsystem_type.sh;fp=jenkins-scripts%2Fsystem_type.sh;h=9aeea20d28b55dba7555b70406012337abd154e1;hb=ebc710af742601214491c5b2b9a4f6847d235d6c;hp=0000000000000000000000000000000000000000;hpb=dcd560890f549f999e0ebe437dcc180bbc628d0b;p=ci-management.git diff --git a/jenkins-scripts/system_type.sh b/jenkins-scripts/system_type.sh new file mode 100755 index 000000000..9aeea20d2 --- /dev/null +++ b/jenkins-scripts/system_type.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# @License EPL-1.0 +############################################################################## +# Copyright (c) 2016 The Linux Foundation and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +############################################################################## + +HOST=$(/bin/hostname) +SYSTEM_TYPE='' + +IFS=',' +for i in "basebuild,basebuild" \ + "centos,centos" \ + "trusty,trusty" \ + "xenial,xenial" +do set -- $i + if [[ $HOST == *"$1"* ]]; then + SYSTEM_TYPE="$2" + break + fi +done + +# Write out the system type to an environment file to then be sourced +echo "SYSTEM_TYPE=${SYSTEM_TYPE}" > /tmp/system_type.sh + +# vim: sw=4 ts=4 sts=4 et :