Merge "Adjust for karaf 4 not happening in carbon"
[releng/builder.git] / jenkins-scripts / system_type.sh
1 #!/bin/bash
2
3 # @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
4 ##############################################################################
5 # Copyright (c) 2016 The Linux Foundation and others.
6 #
7 # All rights reserved. This program and the accompanying materials
8 # are made available under the terms of the Eclipse Public License v1.0
9 # which accompanies this distribution, and is available at
10 # http://www.eclipse.org/legal/epl-v10.html
11 ##############################################################################
12
13 HOST=$(/bin/hostname)
14 SYSTEM_TYPE=''
15
16 IFS=','
17 for i in "java-builder,builder" \
18          "devstack,devstack" \
19          "docker,docker" \
20          "gbp,ubuntu-docker-ovs" \
21          "robot,robot" \
22          "mininet,mininet-ubuntu"
23 do set -- $i
24     if [[ $HOST == *"$1"* ]]; then
25         SYSTEM_TYPE="$2"
26         break
27     fi
28 done
29
30 # Write out the system type to an environment file to then be sourced
31 echo "SYSTEM_TYPE=${SYSTEM_TYPE}" > /tmp/system_type.sh
32
33 # vim: sw=4 ts=4 sts=4 et :