From 9c1c845a51249714a528133a65ba89c70469e472 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Thu, 23 Apr 2015 17:26:40 +0200 Subject: reproducible: add a sane mean to notify the IRC channel when builds finish. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * new column in the database, schedule table * turn $SAVE_ARTIFACTS a true boolean, 0→no artifacts, 1→yes artifacts * $NOTIFY in the build script is text containg a keyword: + if empty no notification will be sent + if "debbindiff" a "$DBDVERSION had trouble with these" will be sent + if "failure" a "no artifacts could have been saved"-like will be sent + any other value trigs a normal message * adapt the maintenance script and the manual scheduler to cope with the new column --- bin/reproducible_schedule_on_demand.sh | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'bin/reproducible_schedule_on_demand.sh') diff --git a/bin/reproducible_schedule_on_demand.sh b/bin/reproducible_schedule_on_demand.sh index 436c6059..27c32dc8 100755 --- a/bin/reproducible_schedule_on_demand.sh +++ b/bin/reproducible_schedule_on_demand.sh @@ -22,14 +22,24 @@ if [ "$SUITE" = "sid" ] ; then SUITE=unstable fi -ARTIFACTS=0 -if [ "$1" = "artifacts" ] ; then - ARTIFACTS=1 - shift - echo - echo "The artifacts of the build(s) will be saved to the location mentioned at the end of the build log(s)." - echo -fi +case "$1" in + "artifacts") + ARTIFACTS=1 + NOTIFY=true + shift + printf "\nThe artifacts of the build(s) will be saved to the location mentioned at the end of the build log(s).\n\n" + ;; + "notify") + ARTIFACTS=0 + NOTIFY=true + shift + printf "\nThe IRC channel will be notify once the build(s) finished.\n\n" + ;; + *) + ARTIFACTS=0 + NOTIFY='' + ;; +esac CANDIDATES="$@" check_candidates @@ -43,10 +53,12 @@ fi MESSAGE="$TOTAL $PACKAGES_TXT $ACTION in $SUITE: ${PACKAGES_NAMES:0:256}$BLABLABLA" if [ $ARTIFACTS -eq 1 ] ; then MESSAGE="$MESSAGE - artifacts will be preserved." +elif $NOTIFY ; then + MESSAGE="$MESSAGE - notification once finished." fi # finally -schedule_packages $ARTIFACTS $PACKAGE_IDS +schedule_packages $PACKAGE_IDS echo echo "$MESSAGE" if [ -z "${BUILD_URL:-}" ] && [ $TOTAL -ne 0 ] ; then -- cgit v1.2.3-54-g00ecf