]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
Added script for setting the test state in the liveboot web interface.
authorMarjan Schiller <marjan.schiller@profitbricks.com>
Thu, 13 Jun 2013 13:13:18 +0000 (15:13 +0200)
committerMarjan Schiller <marjan.schiller@profitbricks.com>
Thu, 13 Jun 2013 13:13:18 +0000 (15:13 +0200)
liveboot_set_test_state.sh [new file with mode: 0755]

diff --git a/liveboot_set_test_state.sh b/liveboot_set_test_state.sh
new file mode 100755 (executable)
index 0000000..743e22c
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/bash
+# copyright 2012 Holger Levsen GPL2 licenced, holger@layer-acht.org
+
+set -e
+
+if [ -z "${BUILD_NUMBER}" ]
+then
+    echo "\$BUILD_NUMBER is empty, not using Jenkins? Please export manually!"
+    exit 1
+fi
+
+if [ -z "${TEST_STATE}" ]
+then
+    echo "\$TEST_STATE is empty, not using Jenkins? Please export manually!"
+    exit 1
+fi
+
+# Checkout liveboot repo
+BUILD_SCRIPT=$(mktemp)
+cat > $BUILD_SCRIPT <<-EOF
+cd /srv/build
+rm liveboot_test_state -rf
+git clone git://git/ri/liveboot.git liveboot_test_state
+cd liveboot_test_state
+git checkout $GIT_BRANCH
+./liveboot_test_reporter.py $BUILD_NUMBER $TEST_STATE
+EOF
+
+bash -x $BUILD_SCRIPT
+
+figlet "OK"
\ No newline at end of file