diff options
author | Mattia Rizzolo <mattia@mapreri.org> | 2015-04-06 15:08:25 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-04-18 17:20:08 +0200 |
commit | 074d179e2e47d89d5efc8256fcfb33efd6b615c5 (patch) | |
tree | 3b277a4a53f697de269ad1d7d6a241f4694475b1 | |
parent | 869c4ef9876b3164609e061f872ce3c956687736 (diff) | |
download | jenkins.debian.net-074d179e2e47d89d5efc8256fcfb33efd6b615c5.tar.xz |
reproducible: build: refactor: slim down the call_debbindiff() function: strip out handle_reproducible()
-rwxr-xr-x | bin/reproducible_build.sh | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh index 67aec9bf..cfe05de1 100755 --- a/bin/reproducible_build.sh +++ b/bin/reproducible_build.sh @@ -109,6 +109,20 @@ handle_ftbfs() { if [ $SAVE_ARTIFACTS -eq 1 ] ; then SAVE_ARTIFACTS=2 ; fi } +handle_reproducible() { + if [ ! -f ./${DBDREPORT} ] && [ -f b1/${BUILDINFO} ] ; then + cp b1/${BUILDINFO} /var/lib/jenkins/userContent/buildinfo/${SUITE}/${ARCH}/ > /dev/null 2>&1 + figlet ${SRCPACKAGE} + echo | tee -a ${RBUILDLOG} + echo "$DBDVERSION found no differences in the changes files, and a .buildinfo file also exists." | tee -a ${RBUILDLOG} + echo "${SRCPACKAGE} built successfully and reproducibly." | tee -a ${RBUILDLOG} + calculate_build_duration + sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO results (package_id, version, status, build_date, build_duration) VALUES ('${SRCPKGID}', '${VERSION}', 'reproducible', '$DATE', '$DURATION')" + sqlite3 -init $INIT ${PACKAGES_DB} "INSERT INTO stats_build (name, version, suite, architecture, status, build_date, build_duration) VALUES ('${SRCPACKAGE}', '${VERSION}', '${SUITE}', '${ARCH}', 'reproducible', '${DATE}', '${DURATION}')" + update_db_and_html + fi +} + init_debbindiff() { # the schroot for debbindiff gets updated once a day. wait patiently if that's the case if [ -f $DBDCHROOT_WRITELOCK ] || [ -f $DBDCHROOT_READLOCK ] ; then @@ -154,6 +168,8 @@ call_debbindiff() { 124) dbd_timeout ;; + 0) + handle_reproducible 1) DEBBINDIFFOUT="$DBDVERSION found issues, please investigate $REPRODUCIBLE_URL/dbd/${SUITE}/${ARCH}/${DBDREPORT}" ;; @@ -162,17 +178,6 @@ call_debbindiff() { SAVE_ARTIFACTS=3 ;; esac - if [ $RESULT -eq 0 ] && [ ! -f ./${DBDREPORT} ] && [ -f b1/${BUILDINFO} ] ; then - cp b1/${BUILDINFO} /var/lib/jenkins/userContent/buildinfo/${SUITE}/${ARCH}/ > /dev/null 2>&1 - figlet ${SRCPACKAGE} - echo - echo "$DBDVERSION found no differences in the changes files, and a .buildinfo file also exists." | tee -a ${RBUILDLOG} - echo "${SRCPACKAGE} built successfully and reproducibly." | tee -a ${RBUILDLOG} - calculate_build_duration - sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO results (package_id, version, status, build_date, build_duration) VALUES ('${SRCPKGID}', '${VERSION}', 'reproducible', '$DATE', '$DURATION')" - sqlite3 -init $INIT ${PACKAGES_DB} "INSERT INTO stats_build (name, version, suite, architecture, status, build_date, build_duration) VALUES ('${SRCPACKAGE}', '${VERSION}', '${SUITE}', '${ARCH}', 'reproducible', '${DATE}', '${DURATION}')" - update_db_and_html - else echo | tee -a ${RBUILDLOG} echo -n "$(date) - ${SRCPACKAGE} failed to build reproducibly in ${SUITE} on ${ARCH} " | tee -a ${RBUILDLOG} cp b1/${BUILDINFO} /var/lib/jenkins/userContent/buildinfo/${SUITE}/${ARCH}/ > /dev/null 2>&1 || true @@ -193,7 +198,6 @@ call_debbindiff() { 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 fi - fi print_out_duration } |