diff options
author | Holger Levsen <holger@layer-acht.org> | 2015-07-10 13:04:58 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-07-10 13:04:58 +0200 |
commit | bd3a7cef4ca381b0f571f4557addcb4c1a48ef08 (patch) | |
tree | 4ef02a8c7e7a5b2891d4b3a994a354cb26145ce1 | |
parent | 8a98f0a55d18bedcabeae87659e8ad7b1dd9e232 (diff) | |
download | jenkins.debian.net-bd3a7cef4ca381b0f571f4557addcb4c1a48ef08.tar.xz |
provide /reproducible-tracker.json, see #785531
-rwxr-xr-x | bin/reproducible_common.py | 1 | ||||
-rwxr-xr-x | 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 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.') |