[23472] in Source-Commits
/svn/athena r23118 - trunk/debathena/scripts/build-server
daemon@ATHENA.MIT.EDU (ghudson@MIT.EDU)
Fri Aug 1 13:18:58 2008
Date: Fri, 1 Aug 2008 13:18:42 -0400 (EDT)
From: ghudson@MIT.EDU
Message-Id: <200808011718.NAA07136@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: ghudson
Date: 2008-08-01 13:18:42 -0400 (Fri, 01 Aug 2008)
New Revision: 23118
Modified:
trunk/debathena/scripts/build-server/autodebathenify
Log:
In autodebathenify, keep on running if we experience a transient
failure.
Modified: trunk/debathena/scripts/build-server/autodebathenify
===================================================================
--- trunk/debathena/scripts/build-server/autodebathenify 2008-08-01 17:05:58 UTC (rev 23117)
+++ trunk/debathena/scripts/build-server/autodebathenify 2008-08-01 17:18:42 UTC (rev 23118)
@@ -58,6 +58,33 @@
EOM
}
+# Similar to error, but do not suppress future runs.
+error_transient() {
+ /usr/sbin/sendmail -t << EOM
+From: Autodebathenify <$error_addr>
+To: Autodebathenify <$error_addr>
+Subject: Autodebathenify failure: $1
+
+Autodebathenify has experienced a transient failure.
+
+Autodebathenify will continue running; investigation is not required
+unless this failure repeats itself. If that happens, see $logfile on
+$(hostname) for more details.
+EOM
+}
+
+# Exit handler. If a subsidiary command exited with status 3, we
+# treat it as a transient failure; otherwise we treat it as a failure
+# requiring human investigation. In either case, remove the run file.
+on_failure() {
+ if [ 3 -eq "$?" ]; then
+ error_transient "$state"
+ else
+ error "$state"
+ fi
+ rm -f "$runfile"
+}
+
# Make sure runs of this script do not overlap.
runfile=$HOME/autodebathenify.running
if [ -e "$runfile" ]; then
@@ -74,8 +101,7 @@
fi
echo $$ > $runfile
-set -e
-trap 'error "$state"; rm -f "$runfile"' EXIT
+trap on_failure EXIT
# Acquire credentials.
state="acquiring credentials"
@@ -84,14 +110,16 @@
aklog athena.mit.edu dev.mit.edu
export PATH=${scripts_dir}:$PATH
+. "$scripts_dir"/debian-versions.sh
state="changing to build dir"
cd "$build_dir"
for pkg in $packages; do
- state="updating $pkg"
- cd "$pkg"
- da ./debathenify-"$pkg" source binary upload
- cd ..
+ for code in $DEBIAN_CODES; do
+ state="updating $pkg for $code"
+ ./debathenify-"$pkg" "$code"-amd64 -A source binary upload
+ ./debathenify-"$pkg" "$code"-amd64 source binary upload
+ done
done
state="cleaning up"