summaryrefslogtreecommitdiffstats
path: root/autobuild.sh
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2010-12-07 09:48:20 +0000
committerRichard W.M. Jones <rjones@redhat.com>2010-12-07 11:26:43 +0000
commit4c5038ab54fb6fdff75ca8d5fdda9e73f48a5050 (patch)
tree551285db32a144ad13652c69fcfc409582ffa39a /autobuild.sh
parentc45b5e7230c6c580645bec46f0c7f8d8dbdf08cf (diff)
downloadlibguestfs-4c5038ab54fb6fdff75ca8d5fdda9e73f48a5050.tar.gz
libguestfs-4c5038ab54fb6fdff75ca8d5fdda9e73f48a5050.tar.xz
libguestfs-4c5038ab54fb6fdff75ca8d5fdda9e73f48a5050.zip
Add autobuild script.
Diffstat (limited to 'autobuild.sh')
-rwxr-xr-xautobuild.sh72
1 files changed, 72 insertions, 0 deletions
diff --git a/autobuild.sh b/autobuild.sh
new file mode 100755
index 00000000..a0b288c2
--- /dev/null
+++ b/autobuild.sh
@@ -0,0 +1,72 @@
+#!/bin/bash -
+
+PROJECT=libguestfs
+FEBOOTSTRAP_PATH=$HOME/d/febootstrap
+MAILTO=libguestfs@redhat.com
+
+#----------------------------------------------------------------------
+# Helper functions.
+
+failed ()
+{
+ mail -s "$(hostname -s) $PROJECT FAILED $1 $gitsha" $MAILTO < local-log
+}
+
+ok ()
+{
+ mail -s "$(hostname -s) $PROJECT success $gitsha" $MAILTO < local-log
+}
+
+#----------------------------------------------------------------------
+
+set -e
+set -x
+
+# Make sure we build and test against latest febootstrap.
+PATH=$FEBOOTSTRAP_PATH:$FEBOOTSTRAP_PATH/helper:$PATH
+
+# Remove any old cache directories.
+rm -rf /tmp/guestfs.* ||:
+
+rm -f local-log
+cat > local-log <<EOF
+
+This is an automatic message generated by the builder on
+$(hostname -s) for $PROJECT. Log files from the build
+follow below.
+
+$(uname -a)
+$(date)
+
+-----
+
+EOF
+exec >> local-log 2>&1
+
+# Pull from the public repo so that we don't need ssh-agent.
+git pull --rebase git://git.annexia.org/git/libguestfs.git master
+git clean -d -f
+
+# The git version we are building.
+gitsha=$(git log|head -1|awk '{print $2}')
+
+# Do the configure step.
+./bootstrap ||:
+./autogen.sh --enable-gcc-warnings || {
+ failed "configure step"
+ exit 1
+}
+
+# Do the build step.
+make || {
+ failed "build step"
+ exit 1
+}
+
+# Run the tests.
+make check || {
+ failed "tests"
+ exit 1
+}
+
+ok