summaryrefslogtreecommitdiffstats
path: root/jenkins-scripts/system_type.sh
diff options
context:
space:
mode:
authorAndrew Grimberg <agrimberg@linuxfoundation.org>2016-09-23 10:56:38 -0700
committerAndrew Grimberg <agrimberg@linuxfoundation.org>2016-09-23 12:01:57 -0700
commit128b3e738f0a3c30342b0d1c7554a3acc49ca8b7 (patch)
treee195b0cf48863298a311b0652867e1e4c1ed66e3 /jenkins-scripts/system_type.sh
parent490530fd80827046db0eca6eb016521f316a4583 (diff)
Jenkins spin-up scripts
Scripts used for Jenkins minion startup when used with OpenStack plugin managed minions Change-Id: I616222a0fab12d8f283b5e633a612551c0d5f313 Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Diffstat (limited to 'jenkins-scripts/system_type.sh')
-rwxr-xr-xjenkins-scripts/system_type.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/jenkins-scripts/system_type.sh b/jenkins-scripts/system_type.sh
new file mode 100755
index 00000000..88210a4c
--- /dev/null
+++ b/jenkins-scripts/system_type.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# @License EPL-1.0 <http://spdx.org/licenses/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" \
+ "ubuntu1404,ubuntu1404" \
+ "ubuntu1604,ubuntu1604"
+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 :