mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-08-15 19:00:11 +02:00
build: include all wiki data in the JSON status output
This commit is contained in:
parent
c1b83c24d1
commit
a2f0356d84
@ -83,7 +83,6 @@ 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:
|
||||||
@ -1266,12 +1265,14 @@ def main():
|
|||||||
.format(id=fdroidserverid))
|
.format(id=fdroidserverid))
|
||||||
if os.cpu_count():
|
if os.cpu_count():
|
||||||
txt += "* host processors: %d\n" % os.cpu_count()
|
txt += "* host processors: %d\n" % os.cpu_count()
|
||||||
|
status_output['hostOsCpuCount'] = os.cpu_count()
|
||||||
if os.path.isfile('/proc/meminfo') and os.access('/proc/meminfo', os.R_OK):
|
if os.path.isfile('/proc/meminfo') and os.access('/proc/meminfo', os.R_OK):
|
||||||
with open('/proc/meminfo') as fp:
|
with open('/proc/meminfo') as fp:
|
||||||
for line in fp:
|
for line in fp:
|
||||||
m = re.search(r'MemTotal:\s*([0-9].*)', line)
|
m = re.search(r'MemTotal:\s*([0-9].*)', line)
|
||||||
if m:
|
if m:
|
||||||
txt += "* host RAM: %s\n" % m.group(1)
|
txt += "* host RAM: %s\n" % m.group(1)
|
||||||
|
status_output['hostProcMeminfoMemTotal'] = m.group(1)
|
||||||
break
|
break
|
||||||
fdroid_path = os.path.realpath(os.path.join(os.path.dirname(__file__), '..'))
|
fdroid_path = os.path.realpath(os.path.join(os.path.dirname(__file__), '..'))
|
||||||
buildserver_config = os.path.join(fdroid_path, 'makebuildserver.config.py')
|
buildserver_config = os.path.join(fdroid_path, 'makebuildserver.config.py')
|
||||||
@ -1281,9 +1282,11 @@ def main():
|
|||||||
m = re.search(r'cpus\s*=\s*([0-9].*)', line)
|
m = re.search(r'cpus\s*=\s*([0-9].*)', line)
|
||||||
if m:
|
if m:
|
||||||
txt += "* guest processors: %s\n" % m.group(1)
|
txt += "* guest processors: %s\n" % m.group(1)
|
||||||
|
status_output['guestVagrantVmCpus'] = m.group(1)
|
||||||
m = re.search(r'memory\s*=\s*([0-9].*)', line)
|
m = re.search(r'memory\s*=\s*([0-9].*)', line)
|
||||||
if m:
|
if m:
|
||||||
txt += "* guest RAM: %s MB\n" % m.group(1)
|
txt += "* guest RAM: %s MB\n" % m.group(1)
|
||||||
|
status_output['guestVagrantVmMemory'] = m.group(1)
|
||||||
txt += "* successful builds: %d\n" % len(build_succeeded)
|
txt += "* successful builds: %d\n" % len(build_succeeded)
|
||||||
txt += "* failed builds: %d\n" % len(failed_builds)
|
txt += "* failed builds: %d\n" % len(failed_builds)
|
||||||
txt += "\n\n"
|
txt += "\n\n"
|
||||||
@ -1291,6 +1294,9 @@ 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')
|
||||||
|
|
||||||
|
if buildserverid:
|
||||||
|
status_output['buildserver'] = {'commitId': buildserverid}
|
||||||
|
|
||||||
if not options.onserver:
|
if not options.onserver:
|
||||||
common.write_status_json(status_output)
|
common.write_status_json(status_output)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user