[Qa-jenkins-scm] [jenkins.debian.net] 01/01: provide /reproducible-tracker.json, see #785531
Holger Levsen
holger at moszumanska.debian.org
Fri Jul 10 11:05:21 UTC 2015
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch master
in repository jenkins.debian.net.
commit bd3a7cef4ca381b0f571f4557addcb4c1a48ef08
Author: Holger Levsen <holger at layer-acht.org>
Date: Fri Jul 10 13:04:58 2015 +0200
provide /reproducible-tracker.json, see #785531
---
bin/reproducible_common.py | 1 +
bin/reproducible_json.py | 20 +++++++++++++++-----
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py
index 2e17b44..c3388be 100755
--- a/bin/reproducible_common.py
+++ b/bin/reproducible_common.py
@@ -39,6 +39,7 @@ BIN_PATH = '/srv/jenkins/bin'
BASE = '/var/lib/jenkins/userContent/reproducible'
REPRODUCIBLE_JSON = BASE + '/reproducible.json'
+REPRODUCIBLE_TRACKER_JSON = BASE + '/reproducible-tracker.json'
REPRODUCIBLE_DB = '/var/lib/jenkins/reproducible.db'
DBD_URI = '/dbd'
diff --git a/bin/reproducible_json.py b/bin/reproducible_json.py
index 3103147..30000f7 100755
--- a/bin/reproducible_json.py
+++ b/bin/reproducible_json.py
@@ -8,7 +8,7 @@
#
# Depends: python3
#
-# Build the reproducible.json file, to provide a nice datasource
+# Build the reproducible.json and reproducibe-tracker.json files, to provide nice datasources
from reproducible_common import *
@@ -18,6 +18,7 @@ import tempfile
output = []
+output4tracker = []
log.info('Creating json dump of current reproducible status')
@@ -35,14 +36,23 @@ for row in result:
pkg = dict(zip(keys, row))
log.debug(pkg)
output.append(pkg)
+ # tracker.d.o should only care about results in unstable
+ if row['suite'] == 'unstable':
+ output4tracker.append(pkg)
+# normal json
tmpfile = tempfile.mkstemp(dir=os.path.dirname(REPRODUCIBLE_JSON))[1]
-
with open(tmpfile, 'w') as fd:
- json.dump(output, fd, indent=4, sort_keys=True)
-
+ json.dump(outputa, fd, indent=4, sort_keys=True)
os.rename(tmpfile, REPRODUCIBLE_JSON)
os.chmod(REPRODUCIBLE_JSON, 0o644)
-log.info(REPRODUCIBLE_URL + '/reproducible.json has been updated.')
+# json for tracker.d.o, thanks to #785531
+tmpfile = tempfile.mkstemp(dir=os.path.dirname(REPRODUCIBLE_TRACKER_JSON))[1]
+with open(tmpfile, 'w') as fd:
+ json.dump(output4tracker, fd, indent=4, sort_keys=True)
+os.rename(tmpfile, REPRODUCIBLE_TRACKER_JSON)
+os.chmod(REPRODUCIBLE_TRACKER_JSON, 0o644)
+
+log.info(REPRODUCIBLE_URL + '/reproducible.json and /reproducible-tracker.json have been updated.')
--
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