[Qa-jenkins-scm] [jenkins.debian.net] 03/10: reproducible db: rename column in the results table: s#builder#job, and add build nodes information

Holger Levsen holger at moszumanska.debian.org
Wed Dec 2 14:27:23 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch to_be_deployed_after_this_week
in repository jenkins.debian.net.

commit 66781d490f9b4653b3bcf081fa6677e678313975
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Sat Oct 17 23:22:34 2015 +0000

    reproducible db: rename column in the results table: s#builder#job, and add build nodes information
---
 bin/reproducible_build.sh          |  4 ++--
 bin/reproducible_db_maintenance.py | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index 50c6956..207affe 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -118,8 +118,8 @@ update_db_and_html() {
 			echo "$(date -u +'%Y-%m-%d %H:%M') $REPRODUCIBLE_URL/$SUITE/$ARCH/$SRCPACKAGE changed from $OLD_STATUS -> $STATUS" >> /srv/reproducible-results/notification-emails/$SRCPACKAGE
 		fi
 	fi
-	sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO results (package_id, version, status, build_date, build_duration, builder) VALUES ('$SRCPKGID', '$VERSION', '$STATUS', '$DATE', '$DURATION', '$JOB')" || \
-	sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO results (package_id, version, status, build_date, build_duration, builder) VALUES ('$SRCPKGID', '$VERSION', '$STATUS', '$DATE', '$DURATION', '$JOB')"
+	sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO results (package_id, version, status, build_date, build_duration, node1, node2, job) VALUES ('$SRCPKGID', '$VERSION', '$STATUS', '$DATE', '$DURATION', '$NODE1', '$NODE2', '$JOB')" || \
+	sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO results (package_id, version, status, build_date, build_duration, node1, node2, job) VALUES ('$SRCPKGID', '$VERSION', '$STATUS', '$DATE', '$DURATION', '$NODE1', '$NODE2', '$JOB')"
 	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, node1, node2, job) VALUES ('$SRCPACKAGE', '$VERSION', '$SUITE', '$ARCH', '$STATUS', '$DATE', '$DURATION', '$NODE1', '$NODE2', '$JOB')" || \
 		sqlite3 -init $INIT ${PACKAGES_DB} "INSERT INTO stats_build (name, version, suite, architecture, status, build_date, build_duration, node1, node2, job) VALUES ('$SRCPACKAGE', '$VERSION', '$SUITE', '$ARCH', '$STATUS', '$DATE', '$DURATION', '$NODE1', '$NODE2', '$JOB')"
diff --git a/bin/reproducible_db_maintenance.py b/bin/reproducible_db_maintenance.py
index 47b5063..ec01205 100755
--- a/bin/reproducible_db_maintenance.py
+++ b/bin/reproducible_db_maintenance.py
@@ -505,6 +505,26 @@ schema_updates = {
         'DROP TABLE stats_build',
         'ALTER TABLE stats_build_tmp RENAME TO stats_build',
         'INSERT INTO rb_schema VALUES ("23", "' + now + '")'],
+    24: [ # the same as #23 but for the results table
+        '''CREATE TABLE results_tmp
+           (id INTEGER PRIMARY KEY,
+            package_id INTEGER NOT NULL,
+            version TEXT NOT NULL,
+            status TEXT NOT NULL,
+            build_date TEXT NOT NULL,
+            build_duration INTEGER DEFAULT 0,
+            node1 TEXT,
+            node2 TEXT,
+            job TEXT NOT NULL,
+            UNIQUE (package_id)
+            FOREIGN KEY(package_id) REFERENCES sources(id))''',
+        '''INSERT INTO results_tmp (id, package_id, version, status,
+                    build_date, build_duration, job)
+           SELECT id, package_id, version, status, build_date, build_duration,
+                    builder FROM results''',
+        'DROP TABLE results',
+        'ALTER TABLE results_tmp RENAME TO results',
+        'INSERT INTO rb_schema VALUES ("24", "' + now + '")'],
 }
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list