mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
build: write status JSON
This commit is contained in:
parent
55935d9a41
commit
c19ef45fd5
1 changed files with 10 additions and 0 deletions
|
|
@ -83,6 +83,7 @@ def build_server(app, build, vcs, build_dir, output_dir, log_dir, force):
|
||||||
buildserverid = subprocess.check_output(['vagrant', 'ssh', '-c',
|
buildserverid = subprocess.check_output(['vagrant', 'ssh', '-c',
|
||||||
'cat /home/vagrant/buildserverid'],
|
'cat /home/vagrant/buildserverid'],
|
||||||
cwd='builder').strip().decode()
|
cwd='builder').strip().decode()
|
||||||
|
status_output['buildserverid'] = buildserverid
|
||||||
logging.debug(_('Fetched buildserverid from VM: {buildserverid}')
|
logging.debug(_('Fetched buildserverid from VM: {buildserverid}')
|
||||||
.format(buildserverid=buildserverid))
|
.format(buildserverid=buildserverid))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
@ -912,6 +913,7 @@ config = None
|
||||||
buildserverid = None
|
buildserverid = None
|
||||||
fdroidserverid = None
|
fdroidserverid = None
|
||||||
start_timestamp = time.gmtime()
|
start_timestamp = time.gmtime()
|
||||||
|
status_output = None
|
||||||
timeout_event = threading.Event()
|
timeout_event = threading.Event()
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -978,6 +980,8 @@ def main():
|
||||||
else:
|
else:
|
||||||
also_check_dir = None
|
also_check_dir = None
|
||||||
|
|
||||||
|
status_output = common.setup_status_output(start_timestamp)
|
||||||
|
|
||||||
repo_dir = 'repo'
|
repo_dir = 'repo'
|
||||||
|
|
||||||
build_dir = 'build'
|
build_dir = 'build'
|
||||||
|
|
@ -1029,6 +1033,8 @@ def main():
|
||||||
# Build applications...
|
# Build applications...
|
||||||
failed_apps = {}
|
failed_apps = {}
|
||||||
build_succeeded = []
|
build_succeeded = []
|
||||||
|
status_output['failedBuilds'] = failed_apps
|
||||||
|
status_output['successfulBuilds'] = build_succeeded
|
||||||
# Only build for 36 hours, then stop gracefully.
|
# Only build for 36 hours, then stop gracefully.
|
||||||
endtime = time.time() + 36 * 60 * 60
|
endtime = time.time() + 36 * 60 * 60
|
||||||
max_build_time_reached = False
|
max_build_time_reached = False
|
||||||
|
|
@ -1201,10 +1207,12 @@ def main():
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error("Error while attempting to publish build log: %s" % e)
|
logging.error("Error while attempting to publish build log: %s" % e)
|
||||||
|
|
||||||
|
common.write_running_status_json(status_output)
|
||||||
if timer:
|
if timer:
|
||||||
timer.cancel() # kill the watchdog timer
|
timer.cancel() # kill the watchdog timer
|
||||||
|
|
||||||
if max_build_time_reached:
|
if max_build_time_reached:
|
||||||
|
status_output['maxBuildTimeReached'] = True
|
||||||
logging.info("Stopping after global build timeout...")
|
logging.info("Stopping after global build timeout...")
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
@ -1263,6 +1271,8 @@ def main():
|
||||||
newpage = site.Pages['build']
|
newpage = site.Pages['build']
|
||||||
newpage.save('#REDIRECT [[' + wiki_page_path + ']]', summary='Update redirect')
|
newpage.save('#REDIRECT [[' + wiki_page_path + ']]', summary='Update redirect')
|
||||||
|
|
||||||
|
common.write_status_json(status_output, options.pretty)
|
||||||
|
|
||||||
# hack to ensure this exits, even is some threads are still running
|
# hack to ensure this exits, even is some threads are still running
|
||||||
common.force_exit()
|
common.force_exit()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue