1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-19 21:30:10 +01:00

gpgsign: write status JSON

This commit is contained in:
Hans-Christoph Steiner 2020-02-18 13:16:55 +01:00
parent 4bb590b6e5
commit ddbdff83bd
No known key found for this signature in database
GPG Key ID: 3E177817BA1B9BFA

View File

@ -20,6 +20,7 @@ import os
import glob import glob
from argparse import ArgumentParser from argparse import ArgumentParser
import logging import logging
import time
from . import _ from . import _
from . import common from . import common
@ -28,6 +29,17 @@ from .exception import FDroidException
config = None config = None
options = None options = None
start_timestamp = time.gmtime()
def status_update_json(signed):
"""Output a JSON file with metadata about this run"""
logging.debug(_('Outputting JSON'))
output = common.setup_status_output(start_timestamp)
if signed:
output['signed'] = signed
common.write_status_json(output)
def main(): def main():
@ -45,6 +57,7 @@ def main():
if config['archive_older'] != 0: if config['archive_older'] != 0:
repodirs.append('archive') repodirs.append('archive')
signed = []
for output_dir in repodirs: for output_dir in repodirs:
if not os.path.isdir(output_dir): if not os.path.isdir(output_dir):
raise FDroidException(_("Missing output directory") + " '" + output_dir + "'") raise FDroidException(_("Missing output directory") + " '" + output_dir + "'")
@ -72,7 +85,9 @@ def main():
if p.returncode != 0: if p.returncode != 0:
raise FDroidException("Signing failed.") raise FDroidException("Signing failed.")
signed.append(filename)
logging.info('Signed ' + filename) logging.info('Signed ' + filename)
status_update_json(signed)
if __name__ == "__main__": if __name__ == "__main__":