From 4805db3c115ed6a0fcb6f2417b5cd280e8c9aa8e Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Mon, 6 Apr 2015 15:43:42 +0200 Subject: reproducible: build: refactor: add irc_message() to reduce hardcoding of kgb-client call --- bin/reproducible_build.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh index b1020b9f..186f934f 100755 --- a/bin/reproducible_build.sh +++ b/bin/reproducible_build.sh @@ -17,6 +17,12 @@ ARCH="amd64" # sleep 1-12 secs to randomize start times /bin/sleep $(echo "scale=1 ; $(shuf -i 1-120 -n 1)/10" | bc ) +irc_message() { + local MESSAGE="$@" + kgb-client --conf /srv/jenkins/kgb/debian-reproducible.conf --relay-msg "$MESSAGE" || true # don't fail the whole job +} + + create_results_dirs() { mkdir -p /var/lib/jenkins/userContent/dbd/${SUITE}/${ARCH} mkdir -p /var/lib/jenkins/userContent/rbuild/${SUITE}/${ARCH} @@ -45,10 +51,10 @@ cleanup_all() { if [ $SAVE_ARTIFACTS -eq 3 ] ; then MESSAGE="$MESSAGE, $DBDVERSION had troubles with these..." fi - kgb-client --conf /srv/jenkins/kgb/debian-reproducible.conf --relay-msg "$MESSAGE" || true # don't fail the whole job + irc_message "$MESSAGE" elif [ $SAVE_ARTIFACTS -eq 2 ] ; then echo "No artifacts were saved for this build." | tee -a ${RBUILDLOG} - kgb-client --conf /srv/jenkins/kgb/debian-reproducible.conf --relay-msg "Check $REPRODUCIBLE_URL/rbuild/${SUITE}/${ARCH}/${SRCPACKAGE}_${EVERSION}.rbuild.log to find out why no artifacts were saved." || true # don't fail the whole job + irc_message "Check $REPRODUCIBLE_URL/rbuild/${SUITE}/${ARCH}/${SRCPACKAGE}_${EVERSION}.rbuild.log to find out why no artifacts were saved." fi rm -r $TMPDIR } @@ -128,7 +134,7 @@ handle_ftbr() { if [ "${OLD_STATUS}" = "reproducible" ]; then MESSAGE="status changed from reproducible -> unreproducible. ${REPRODUCIBLE_URL}/${SUITE}/${ARCH}/${SRCPACKAGE}" echo "\n$MESSAGE" | tee -a ${RBUILDLOG} - # kgb-client --conf /srv/jenkins/kgb/debian-reproducible.conf --relay-msg "$MESSAGE" || true # don't fail the whole job + # irc_message "$MESSAGE" fi } -- cgit v1.2.3-54-g00ecf