commit: c29fbdb8c8b98b1cc677e575c8142b1a5289bbc5
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 10 06:24:53 2024 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Wed Jan 10 06:24:53 2024 +0000
URL: https://gitweb.gentoo.org/proj/binhost.git/commit/?id=c29fbdb8
Better fail detection logic
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
builders/demeter/binhost-update | 7 +++++--
builders/jiji/binhost-update | 7 +++++--
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/builders/demeter/binhost-update b/builders/demeter/binhost-update
index 9e6822b..9ea2afc 100755
--- a/builders/demeter/binhost-update
+++ b/builders/demeter/binhost-update
@@ -92,6 +92,8 @@ echo Syncing host &>> ${TMPFILE}
emerge --sync -q &>> ${TMPFILE}
+anyfail=0
+
for n in ${NSPAWN_NAMES} ; do
echo Machine ${n} &>> ${TMPFILE}
echo &>> ${TMPFILE}
@@ -99,6 +101,7 @@ for n in ${NSPAWN_NAMES} ; do
git pull -q &>> ${TMPFILE}
cd /root &>> ${TMPFILE}
systemd-nspawn --bind /var/cache/distfiles --bind-ro
/var/db/repos/gentoo --tmpfs=/var/tmp:mode=1777,size=32g -M ${n}
/root/bin/run-update &>> ${TMPFILE}
+ let "anyfail+=$?"
done
@@ -106,9 +109,9 @@ upsync_binpackages
/var/lib/machines/binhost-amd64-x86-64-kde/var/cache/binpkgs
upsync_binpackages
/var/lib/machines/binhost-amd64-x86-64-v3-kde/var/cache/binpkgs
amd64/17.1/x86-64-v3 &>> ${TMPFILE}
-if [[ $(wc -l ${TMPFILE} | sed -e 's: .*$::g') -gt ${MAX_HARMLESS} ]] ; then
+if [[ ${anyfail} -gt 0 ]] ; then
- send_email "Update possibly failed" "Binhost ${BINHOST_NAME} update produced
long output" ${TMPFILE}
+ send_email "Update failed" "Binhost ${BINHOST_NAME} update failed in at
least one nspawn" ${TMPFILE}
fi
diff --git a/builders/jiji/binhost-update b/builders/jiji/binhost-update
index f9d1b7b..0becbb9 100755
--- a/builders/jiji/binhost-update
+++ b/builders/jiji/binhost-update
@@ -92,6 +92,8 @@ echo Syncing host &>> ${TMPFILE}
emerge --sync -q &>> ${TMPFILE}
+anyfail=0
+
for n in ${NSPAWN_NAMES} ; do
echo Machine ${n} &>> ${TMPFILE}
echo &>> ${TMPFILE}
@@ -99,14 +101,15 @@ for n in ${NSPAWN_NAMES} ; do
git pull -q &>> ${TMPFILE}
cd /root &>> ${TMPFILE}
systemd-nspawn --bind /var/cache/distfiles --bind-ro
/var/db/repos/gentoo --tmpfs=/var/tmp:mode=1777,size=64g -M ${n}
/root/bin/run-update &>> ${TMPFILE}
+ let "anyfail+=$?"
done
upsync_binpackages /var/lib/machines/binhost-arm64-kde/var/cache/binpkgs
arm64/17.0/arm64 &>> ${TMPFILE}
upsync_binpackages /var/lib/machines/binhost-arm64-kde-23/var/cache/binpkgs
arm64/23.0/arm64 &>> ${TMPFILE}
-if [[ $(wc -l ${TMPFILE} | sed -e 's: .*$::g') -gt ${MAX_HARMLESS} ]] ; then
+if [[ ${anyfail} -gt 0 ]] ; then
- send_email "Update possibly failed" "Binhost ${BINHOST_NAME} update produced
long output" ${TMPFILE}
+ send_email "Update failed" "Binhost ${BINHOST_NAME} update failed in at
least one nspawn" ${TMPFILE}
fi