run script: Don't depend on libtool being installed.
[libguestfs.git] / autobuild.sh
1 #!/bin/bash -
2
3 PROJECT=libguestfs
4 FEBOOTSTRAP_PATH=$HOME/d/febootstrap
5 MAILTO=libguestfs@redhat.com
6 HOSTNAME="$(hostname -s)"
7
8 #----------------------------------------------------------------------
9 # Helper functions.
10
11 failed ()
12 {
13     mail -s "$HOSTNAME $PROJECT FAILED $1 $gitsha" $MAILTO < local-log
14 }
15
16 ok ()
17 {
18     mail -s "$HOSTNAME $PROJECT success $gitsha" $MAILTO < local-log
19 }
20
21 #----------------------------------------------------------------------
22
23 set -e
24 set -x
25
26 # Make sure we build and test against latest febootstrap.
27 PATH=$FEBOOTSTRAP_PATH:$FEBOOTSTRAP_PATH/helper:$PATH
28
29 # Remove any old cache directories.
30 rm -rf /tmp/guestfs.* ||:
31
32 rm -f local-log
33 cat > local-log <<EOF
34
35 This is an automatic message generated by the builder on
36 $HOSTNAME for $PROJECT.  Log files from the build
37 follow below.
38
39 $(uname -a)
40 $(date)
41
42 -----
43
44 EOF
45 exec >> local-log 2>&1
46
47 # Pull from the public repo so that we don't need ssh-agent.
48 git pull --rebase git://git.annexia.org/git/libguestfs.git master
49 git clean -d -f
50
51 # The git version we are building.
52 gitsha=$(git log|head -1|awk '{print $2}')
53
54 # Do the configure step.
55 ./bootstrap ||:
56 ./autogen.sh --enable-gcc-warnings || {
57     failed "configure step"
58     exit 1
59 }
60
61 make clean ||:
62
63 # Do the build step.
64 make || {
65     failed "build step"
66     exit 1
67 }
68
69 # Tests that are skipped (note that these tests should be fixed).
70 case "$HOSTNAME" in
71     builder-ubuntu)
72         # get_e2uuid: /dev/vdc: [no error message]
73         # get_e2label: /dev/vda1: [no error message]
74         # Diagnosis: either mkjournal is not writing a UUID or blkid is
75         # unable to pick it up.
76         export SKIP_TEST_GET_E2UUID=1
77         export SKIP_TEST_SET_E2UUID=1
78         export SKIP_TEST_SET_E2LABEL=1
79
80         # Avoids:
81         # device-mapper: ioctl: unable to remove open device temporary-cryptsetup-661
82         # device-mapper: remove ioctl failed: Device or resource busy
83         # guestfsd: error: Device lukstest is busy.
84         # Diagnosis: appears to be a bug in cryptsetup on Ubuntu.
85         # https://bugzilla.redhat.com/show_bug.cgi?id=527056
86         export SKIP_TEST_LUKS_SH=1
87         ;;
88 esac
89
90 # Run the tests.
91 make check || {
92     failed "tests"
93     exit 1
94 }
95
96 ok