Add TODO file.
[febootstrap.git] / autobuild.sh
1 #!/bin/bash -
2
3 PROJECT=febootstrap
4 MAILTO=libguestfs@redhat.com
5 HOSTNAME="$(hostname -s)"
6
7 #----------------------------------------------------------------------
8 # Helper functions.
9
10 failed ()
11 {
12     mail -s "$HOSTNAME $PROJECT FAILED $1 $gitsha" $MAILTO < local-log
13 }
14
15 ok ()
16 {
17     mail -s "$HOSTNAME $PROJECT success $gitsha" $MAILTO < local-log
18 }
19
20 #----------------------------------------------------------------------
21
22 set -e
23 set -x
24
25 rm -f local-log
26 cat > local-log <<EOF
27
28 This is an automatic message generated by the builder on
29 $HOSTNAME for $PROJECT.  Log files from the build
30 follow below.
31
32 $(uname -a)
33 $(date)
34
35 -----
36
37 EOF
38 exec >> local-log 2>&1
39
40 # Pull from the public repo so that we don't need ssh-agent.
41 git pull --rebase git://git.annexia.org/git/febootstrap.git master
42 git clean -d -f
43
44 # The git version we are building.
45 gitsha=$(git log|head -1|awk '{print $2}')
46
47 # Do the configure step.
48 ./autogen.sh || {
49     failed "configure step"
50     exit 1
51 }
52
53 # Do the build step.
54 make || {
55     failed "build step"
56     exit 1
57 }
58
59 # Run the tests.
60 make check || {
61     failed "tests"
62     exit 1
63 }
64
65 ok