1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-03 17:50:11 +02:00

Sync status json after every build

dfdd2913 the logic to only write the status json upon build but before
the build happens. This makes sure that it is written after a
successful build or exception.
This commit is contained in:
Jochen Sprickerhof 2022-10-13 08:29:31 +02:00 committed by Hans-Christoph Steiner
parent cd8ded730a
commit 9c0d50a9b2

View File

@ -877,9 +877,6 @@ def trybuild(app, build, build_dir, output_dir, log_dir, also_check_dir,
logging.info("Building version %s (%s) of %s" % (
build.versionName, build.versionCode, app.id))
if not onserver:
common.write_running_status_json(status_output)
if server:
# When using server mode, still keep a local cache of the repo, by
# grabbing the source now.
@ -1199,6 +1196,9 @@ def main():
build_succeeded.append(app)
build_succeeded_ids.append([app['id'], build.versionCode])
if not options.onserver:
common.write_running_status_json(status_output)
except VCSException as vcse:
reason = str(vcse).split('\n', 1)[0] if options.verbose else str(vcse)
logging.error("VCS error while building app %s: %s" % (
@ -1210,6 +1210,9 @@ def main():
common.deploy_build_log_with_rsync(
appid, build.versionCode, "".join(traceback.format_exc())
)
if not options.onserver:
common.write_running_status_json(status_output)
except FDroidException as e:
tstamp = time.strftime("%Y-%m-%d %H:%M:%SZ", time.gmtime())
with open(os.path.join(log_dir, appid + '.log'), 'a+') as f:
@ -1228,6 +1231,9 @@ def main():
common.deploy_build_log_with_rsync(
appid, build.versionCode, "".join(traceback.format_exc())
)
if not options.onserver:
common.write_running_status_json(status_output)
except Exception as e:
logging.error("Could not build app %s due to unknown error: %s" % (
appid, traceback.format_exc()))
@ -1238,6 +1244,8 @@ def main():
common.deploy_build_log_with_rsync(
appid, build.versionCode, "".join(traceback.format_exc())
)
if not options.onserver:
common.write_running_status_json(status_output)
if timer:
timer.cancel() # kill the watchdog timer