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