aboutsummaryrefslogtreecommitdiffstats
path: root/jenkins-scripts/system_type.sh
diff options
context:
space:
mode:
authorJan-Simon Möller <jsmoeller@linuxfoundation.org>2016-08-16 18:26:19 +0200
committerJan-Simon Möller <jsmoeller@linuxfoundation.org>2016-08-17 13:27:14 +0200
commit46ae6ad6151e3a05d80a0d7cfd9e44841fb4bcfd (patch)
tree1b2c52cd19639f490c2b56cde493e0a959885fc0 /jenkins-scripts/system_type.sh
parent245ec5ec552c8c97e867c03aa9645834886cbf2b (diff)
Initial version of the ci-management repo
Based on the open-o template. Modified for AGL. v2 fixed host key and only pushing ci-management jobs. - fix macro vs. definition in file Change-Id: I2de02a572a5d8ca1bf6b7a56bfd2e30bfe18fa9a Signed-off-by: Jan-Simon Möller <jsmoeller@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..9aeea20d
--- /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" \
+ "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 :