diff options
author | Mattia Rizzolo <mattia@mapreri.org> | 2015-04-06 16:41:45 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-04-18 17:20:08 +0200 |
commit | 9e01aa041248abea05c7167b54ed0445f44d73c0 (patch) | |
tree | 1ebe30b695074e22f50fbc9d164704d3d1c7c293 /bin | |
parent | e29ebcaaebcebc8f03c12930cb45c735f4ec6905 (diff) | |
download | jenkins.debian.net-9e01aa041248abea05c7167b54ed0445f44d73c0.tar.xz |
reproducible: build: refactor: also update stats_build table in update_db_and_html()
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_build.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh index 5e7a49f7..1c1548b3 100755 --- a/bin/reproducible_build.sh +++ b/bin/reproducible_build.sh @@ -74,6 +74,9 @@ update_db_and_html() { # everything passed at this function is saved as a status of this package in the db local STATUS="$@" sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO results (payyckage_id, version, status, build_date, build_duration) VALUES ('${SRCPKGID}', 'None', '$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}')" + fi # unmark build since it's properly finished sqlite3 -init $INIT ${PACKAGES_DB} "DELETE FROM schedule WHERE package_id='$SRCPKGID';" set +x @@ -112,7 +115,6 @@ handle_not_for_us() { handle_ftbfs() { echo "${SRCPACKAGE} failed to build from source." calculate_build_duration - sqlite3 -init $INIT ${PACKAGES_DB} "INSERT INTO stats_build (name, version, suite, architecture, status, build_date, build_duration) VALUES ('${SRCPACKAGE}', '${VERSION}', '${SUITE}', '${ARCH}', 'FTBFS', '${DATE}', '${DURATION}')" update_db_and_html "FTBFS" if [ $SAVE_ARTIFACTS -eq 1 ] ; then SAVE_ARTIFACTS=2 ; fi } @@ -132,7 +134,6 @@ handle_ftbr() { echo "$DBDVERSION produced no output (which is strange)." | tee -a $RBUILDLOG fi calculate_build_duration - sqlite3 -init $INIT ${PACKAGES_DB} "INSERT INTO stats_build (name, version, suite, architecture, status, build_date, build_duration) VALUES ('${SRCPACKAGE}', '${VERSION}', '${SUITE}', '${ARCH}', 'unreproducible', '${DATE}', '${DURATION}')" update_db_and_html "unreproducible" # notification for changing status local OLD_STATUS=$(sqlite3 -init $INIT ${PACKAGES_DB} "SELECT status FROM results WHERE package_id='${SRCPKGID}'") @@ -151,7 +152,6 @@ handle_reproducible() { 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} "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 "reproducible" else echo "Debbindiff says the build is reproducible, but either there is a debbindiff file or there is no .buildinfo. Please investigate" | tee -a $RBUILDLOG |