summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-05-26 21:34:43 +0200
committerHolger Levsen <holger@layer-acht.org>2015-05-29 16:24:59 +0200
commitb691349c5e8f74ab921d88a281245aceb42b3806 (patch)
tree3ac699e7ae7ed59c421fbcdcad52d5bd2ca85357 /bin
parent0c2a008833b92823e1a7a4c21bf66b431be9ccc4 (diff)
downloadjenkins.debian.net-b691349c5e8f74ab921d88a281245aceb42b3806.tar.xz
reproducible: add another flag to the db, "notify_maintainer" to indicate that any status change on this package should be mailed to the maintainers. Also teach the build script how to handle that, emailing $pkgname@packages.debian.org
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_build.sh10
-rwxr-xr-xbin/reproducible_db_maintenance.py3
2 files changed, 12 insertions, 1 deletions
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index d14bc478..6a166aec 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -119,6 +119,13 @@ update_db_and_html() {
if [ -z "$VERSION" ] ; then
VERSION="None"
fi
+ local OLD_STATUS=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT status FROM results WHERE package_id='${SRCPKGID}'")
+ # notification for changing status
+ if [ "$OLD_STATUS" != "$STATUS" ] && [ "$NOTIFY_MAINTAINER" -eq 1 ]; then
+ echo "More information on <URL:$REPRODUCIBLE_URL/$SUITE/$ARCH/$SRCHPACKAGE>, feel free to reply to this email to get more help." | \
+ mail -s "Reproducibly of package $SRCPACKAGE changed: $OLD_STATUS → $STATUS" \
+ -a "From: reproducible-builds@lists.alioth.debian.org" "$SRCPACKAGE@packages.debian.org"
+ fi
sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO results (package_id, version, status, build_date, build_duration) VALUES ('${SRCPKGID}', '$VERSION', '$STATUS', '$DATE', '$DURATION')"
if [ ! -z "$DURATION" ] ; then # this happens when not 404 and not_for_us
sqlite3 -init $INIT ${PACKAGES_DB} "INSERT INTO stats_build (name, version, suite, architecture, status, build_date, build_duration) VALUES ('${SRCPACKAGE}', '${VERSION}', '${SUITE}', '${ARCH}', '${STATUS}', '${DATE}', '${DURATION}')"
@@ -305,7 +312,7 @@ call_debbindiff() {
}
choose_package () {
- local RESULT=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT s.suite, s.id, s.name, sch.date_scheduled, sch.save_artifacts, sch.notify FROM schedule AS sch JOIN sources AS s ON sch.package_id=s.id WHERE sch.date_build_started = '' ORDER BY date_scheduled LIMIT 1")
+ local RESULT=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT s.suite, s.id, s.name, sch.date_scheduled, sch.save_artifacts, sch.notify, s.notify_maintainer FROM schedule AS sch JOIN sources AS s ON sch.package_id=s.id WHERE sch.date_build_started = '' ORDER BY date_scheduled LIMIT 1")
SUITE=$(echo $RESULT|cut -d "|" -f1)
SRCPKGID=$(echo $RESULT|cut -d "|" -f2)
SRCPACKAGE=$(echo $RESULT|cut -d "|" -f3)
@@ -321,6 +328,7 @@ choose_package () {
SCHEDULED_DATE=$(echo $RESULT|cut -d "|" -f4)
SAVE_ARTIFACTS=$(echo $RESULT|cut -d "|" -f5)
NOTIFY=$(echo $RESULT|cut -d "|" -f6)
+ NOTIFY_MAINTAINER=$(echo $RESULT|cut -d "|" -f7)
if [ -z "$RESULT" ] ; then
echo "No packages scheduled, sleeping 30m."
sleep 30m
diff --git a/bin/reproducible_db_maintenance.py b/bin/reproducible_db_maintenance.py
index b3aa9385..b2947384 100755
--- a/bin/reproducible_db_maintenance.py
+++ b/bin/reproducible_db_maintenance.py
@@ -373,6 +373,9 @@ schema_updates = {
date_request INTEGER NOT NULL)''',
'ALTER TABLE schedule ADD COLUMN scheduler TEXT',
'INSERT INTO rb_schema VALUES ("13", "' + now + '")'],
+ 14: [ # column to enable mail notification to maintainers
+ 'ALTER TABLE sources ADD COLUMN notify_maintainer INTEGER NOT NULL DEFAULT 0',
+ 'INSERT INTO rb_schema VALUES ("14", "' + now + '")'],
}