[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible: refactor and make it only send one mail for rebooting future nodes
Holger Levsen
gitlab at salsa.debian.org
Wed Sep 4 13:25:20 BST 2019
Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net
Commits:
2d836061 by Holger Levsen at 2019-09-04T12:24:58Z
reproducible: refactor and make it only send one mail for rebooting future nodes
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
1 changed file:
- hosts/common/etc/rc.local
Changes:
=====================================
hosts/common/etc/rc.local
=====================================
@@ -26,8 +26,8 @@ send_back_to_the_future() {
fi
# set fake date
date --set="+398 days +6 hours + 23 minutes"
- # finally report success
- echo "$(date -u) - system is running in the future now" | mail -s "$(hostname -f) in the future" root
+ # modify MESSAGE for notification
+ MESSAGE="$MESSAGE in the future"
}
put_schroots_on_tmpfs() {
@@ -59,20 +59,10 @@ fixup_pbuilder_lockfiles() {
rm -f /var/cache/pbuilder/*.tgz.tmp
}
-#
-# init, notify about reboots
-#
+###
+### main
+###
MESSAGE="$(hostname -f) rebooted"
-echo "$(date -u) - system was rebooted" | mail -s "$MESSAGE" root
-
-#
-# notify jenkins reboots on irc
-#
-if [ "$(hostname)" = "jenkins" ] ; then
- for channel in debian-qa reproducible-builds ; do
- kgb-client --conf /srv/jenkins/kgb/$channel.conf --relay-msg "$MESSAGE"
- done
-fi
#
# fixup /(dev|run)/shm if needed
@@ -105,6 +95,15 @@ esac
#
fixup_pbuilder_lockfiles
+#
+# notify jenkins reboots on irc
+#
+if [ "$(hostname)" = "jenkins" ] ; then
+ for channel in debian-qa reproducible-builds ; do
+ kgb-client --conf /srv/jenkins/kgb/$channel.conf --relay-msg "$MESSAGE"
+ done
+fi
+
#
# run some hosts in the future
#
@@ -122,5 +121,9 @@ case $(hostname) in
*) ;;
esac
-echo "$(date -u) - system booted up."
+#
+# notify about reboots
+#
+echo "$(date -u) - system was rebooted." | mail -s "$MESSAGE" root
+
exit 0
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/2d8360611ecff514ee62c1a80e3f209629f805bc
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/2d8360611ecff514ee62c1a80e3f209629f805bc
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20190904/33504f8d/attachment-0001.html>
More information about the Qa-jenkins-scm
mailing list