From bd3a7cef4ca381b0f571f4557addcb4c1a48ef08 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Fri, 10 Jul 2015 13:04:58 +0200 Subject: provide /reproducible-tracker.json, see #785531 --- bin/reproducible_common.py | 1 + bin/reproducible_json.py | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py index 2e17b442..c3388bef 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 3103147d..30000f7b 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.') -- cgit v1.2.3-70-g09d2