Auto Update CSIT Jobs to run for oxygen
[releng/builder.git] / jenkins-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          "devstack,devstack" \
18          "docker,docker" \
19          "gbp,ubuntu-docker-ovs" \
20          "robot,robot" \
21          "mininet,mininet-ubuntu"
22 do set -- $i
23     if [[ $HOST == *"$1"* ]]; then
24         SYSTEM_TYPE="$2"
25         break
26     fi
27 done
28
29 # Write out the system type to an environment file to then be sourced
30 echo "SYSTEM_TYPE=${SYSTEM_TYPE}" > /tmp/system_type.sh
31
32 # vim: sw=4 ts=4 sts=4 et :