Put lastbuild log on wiki by vercode (with redirect)

This commit is contained in:
Ciaran Gultnieks 2014-07-17 14:05:16 +01:00
parent 40945aded7
commit f5890646e6
2 changed files with 7 additions and 2 deletions

View file

@ -1067,9 +1067,14 @@ def main():
if options.wiki and wikilog: if options.wiki and wikilog:
try: try:
newpage = site.Pages[app['id'] + '/lastbuild'] # Write a page with the last build log for this version code
lastbuildpage = app['id'] + '/lastbuild_' + thisbuild['vercode']
newpage = site.Pages[lastbuildpage]
txt = "Build completed at " + time.strftime("%Y-%m-%d %H:%M:%SZ", time.gmtime()) + "\n\n" + wikilog txt = "Build completed at " + time.strftime("%Y-%m-%d %H:%M:%SZ", time.gmtime()) + "\n\n" + wikilog
newpage.save(txt, summary='Build log') newpage.save(txt, summary='Build log')
# Redirect from /lastbuild to the most recent build log
newpage = site.Pages[app['id'] + '/lastbuild']
newpage.save('#REDIRECT [[' + lastbuildpage + ']]', summary='Update redirect')
except: except:
logging.error("Error while attempting to publish build log") logging.error("Error while attempting to publish build log")

View file

@ -144,7 +144,7 @@ def update_wiki(apps, apks):
buildfails = True buildfails = True
apklist.append({'versioncode': int(thisbuild['vercode']), apklist.append({'versioncode': int(thisbuild['vercode']),
'version': thisbuild['version'], 'version': thisbuild['version'],
'buildproblem': "The build for this version appears to have failed. Check the [[{0}/lastbuild|build log]].".format(app['id']) 'buildproblem': "The build for this version appears to have failed. Check the [[{0}/lastbuild_{1}|build log]].".format(app['id'], thisbuild['vercode'])
}) })
if app['Current Version Code'] == '0': if app['Current Version Code'] == '0':
cantupdate = True cantupdate = True