]> granicus.if.org Git - docbook-dsssl/commitdiff
Refined e-mail reporting of docbook-build problems.
authorMichael Smith <xmldoc@users.sourceforge.net>
Wed, 29 Aug 2007 10:47:10 +0000 (10:47 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Wed, 29 Aug 2007 10:47:10 +0000 (10:47 +0000)
releasetools/docbook-build

index eb123648545f2249ddee5625d1534496b5ffbe2d..59314bd227c092605368679dd16fe29e66d43a8c 100755 (executable)
@@ -343,21 +343,38 @@ EOF
     ssh -l $SITEUSER $SITEHOST "(cd $SITEBASE; chmod 664 *.zip *.log; touch $DISTRO)"
     fi
 
-    # set up the e-mail message headers for buildbot message
+    # set up the e-mail From and To headers for buildbot message
     cat <<- EOF > $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt
 From: snapshot buildbot <smith@sideshowbarker.net>
 To: Michael(tm) Smith <smith@sideshowbarker.net>
-Subject: snapshot $REVISION
-
 EOF
 
-    # run buildcheck and copy the output to the beginning of the
-    # buildbot message
-    $DOCBOOK_SVN/buildtools/build-check $LOGDIR/docbook-$DISTRO-$RELEASEVERSION.log.tmp >> $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt
-    # copy the entire log file to the buildbot message
-    cat $LOGDIR/docbook-$DISTRO-$RELEASEVERSION.log.tmp >> $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt
-    echo >> $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt
-    echo "buildcheck output:" >> $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt
+    # Run build-check and determine if it exits without any errors
+    if $DOCBOOK_SVN/buildtools/build-check $LOGDIR/docbook-$DISTRO-$RELEASEVERSION.log.tmp
+    then
+      # build-check completed successfully, so prepare the
+      # buildbot message accordingly
+      echo "Subject: snapshot $REVISION now available" >> $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt
+      echo >> $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt
+      echo "snapshot $REVISION appears to have been built successfully" >> $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt
+      echo >> $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt
+      echo "http://docbook.sourceforge.net/snapshots/" >> $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt
+    else
+      # build-check did not complete successfully, so prepare
+      # the buildbot message accordingly
+      echo "Subject: snapshot build is broken (r$REVISION)" >> $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt
+      echo >> $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt
+      echo "The snapshot build appears to be broken at r$REVISION or before. the following problems occurred:" >> $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt
+      echo "During the r$REVISION snapshot build, the following problems were found:" >> $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt
+      echo >> $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt
+      # run buildcheck again and copy the output to the beginning
+      # of the buildbot message
+      $DOCBOOK_SVN/buildtools/build-check $LOGDIR/docbook-$DISTRO-$RELEASEVERSION.log.tmp >> $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt
+      echo >> $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt
+      # copy the entire log file to the buildbot message
+      cat $LOGDIR/docbook-$DISTRO-$RELEASEVERSION.log.tmp >> $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt
+      echo >> $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt
+    fi
 
     # send the buildbot message
     /usr/sbin/sendmail -f smith@sideshowbarker.net smith@sideshowbarker.net < $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt