1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-20 13:50:12 +01:00

build: include buildserverid in build log for wiki

This commit is contained in:
Hans-Christoph Steiner 2017-02-09 23:49:42 +01:00
parent 57c3ba413c
commit 837fc99d74

View File

@ -246,6 +246,8 @@ def release_vm():
def build_server(app, build, vcs, build_dir, output_dir, force): def build_server(app, build, vcs, build_dir, output_dir, force):
"""Do a build on the build server.""" """Do a build on the build server."""
global buildserverid
try: try:
paramiko paramiko
except NameError: except NameError:
@ -258,6 +260,10 @@ def build_server(app, build, vcs, build_dir, output_dir, force):
sshinfo = get_clean_vm() sshinfo = get_clean_vm()
try: try:
if not buildserverid:
buildserverid = subprocess.check_output(['vagrant', 'ssh', '-c',
'cat /home/vagrant/buildserverid'],
cwd='builder').rstrip()
# Open SSH connection... # Open SSH connection...
logging.info("Connecting to virtual machine...") logging.info("Connecting to virtual machine...")
@ -1039,11 +1045,12 @@ def parse_commandline():
options = None options = None
config = None config = None
buildserverid = None
def main(): def main():
global options, config global options, config, buildserverid
options, parser = parse_commandline() options, parser = parse_commandline()
@ -1214,9 +1221,12 @@ def main():
fdroidserverid = fp.read().rstrip() fdroidserverid = fp.read().rstrip()
txt = "* build completed at " + time.strftime("%Y-%m-%d %H:%M:%SZ", time.gmtime()) + '\n' \ txt = "* build completed at " + time.strftime("%Y-%m-%d %H:%M:%SZ", time.gmtime()) + '\n' \
+ '* fdroidserverid: [https://gitlab.com/fdroid/fdroidserver/commit/' \ + '* fdroidserverid: [https://gitlab.com/fdroid/fdroidserver/commit/' \
+ fdroidserverid + ' ' + fdroidserverid + ']\n\n' \ + fdroidserverid + ' ' + fdroidserverid + ']\n\n'
+ tools_version_log + '\n\n' \ if options.onserver:
+ '== Build Log ==\n\n' + wikilog txt += '* buildserverid: [https://gitlab.com/fdroid/fdroidserver/commit/' \
+ buildserverid + ' ' + buildserverid + ']\n\n'
txt += tools_version_log + '\n\n'
txt += '== Build Log ==\n\n' + wikilog
newpage.save(txt, summary='Build log') newpage.save(txt, summary='Build log')
# Redirect from /lastbuild to the most recent build log # Redirect from /lastbuild to the most recent build log
newpage = site.Pages[appid + '/lastbuild'] newpage = site.Pages[appid + '/lastbuild']