mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 23:40:29 +03:00
wiki: log server start/stop times and command line
This commit is contained in:
parent
cd3e531731
commit
ef69bbff34
1 changed files with 26 additions and 0 deletions
|
|
@ -35,6 +35,7 @@ from .exception import FDroidException
|
||||||
|
|
||||||
config = None
|
config = None
|
||||||
options = None
|
options = None
|
||||||
|
start_timestamp = time.gmtime()
|
||||||
|
|
||||||
BINARY_TRANSPARENCY_DIR = 'binary_transparency'
|
BINARY_TRANSPARENCY_DIR = 'binary_transparency'
|
||||||
|
|
||||||
|
|
@ -583,6 +584,28 @@ def push_binary_transparency(git_repo_path, git_remote):
|
||||||
origin.push('master')
|
origin.push('master')
|
||||||
|
|
||||||
|
|
||||||
|
def update_wiki():
|
||||||
|
try:
|
||||||
|
import mwclient
|
||||||
|
site = mwclient.Site((config['wiki_protocol'], config['wiki_server']),
|
||||||
|
path=config['wiki_path'])
|
||||||
|
site.login(config['wiki_user'], config['wiki_password'])
|
||||||
|
|
||||||
|
# Write a page with the last build log for this version code
|
||||||
|
wiki_page_path = 'deploy_' + time.strftime('%s', start_timestamp)
|
||||||
|
newpage = site.Pages[wiki_page_path]
|
||||||
|
txt = ''
|
||||||
|
txt += "* command line: <code>" + ' '.join(sys.argv) + "</code>\n"
|
||||||
|
txt += "* started at " + common.get_wiki_timestamp(start_timestamp) + '\n'
|
||||||
|
txt += "* completed at " + common.get_wiki_timestamp() + '\n'
|
||||||
|
txt += "\n\n"
|
||||||
|
newpage.save(txt, summary='Run log')
|
||||||
|
newpage = site.Pages['deploy']
|
||||||
|
newpage.save('#REDIRECT [[' + wiki_page_path + ']]', summary='Update redirect')
|
||||||
|
except Exception as e:
|
||||||
|
logging.error(_('Error while attempting to publish log: %s') % e)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
global config, options
|
global config, options
|
||||||
|
|
||||||
|
|
@ -723,6 +746,9 @@ def main():
|
||||||
push_binary_transparency(BINARY_TRANSPARENCY_DIR,
|
push_binary_transparency(BINARY_TRANSPARENCY_DIR,
|
||||||
binary_transparency_remote)
|
binary_transparency_remote)
|
||||||
|
|
||||||
|
if config.get('wiki_server') and config.get('wiki_path'):
|
||||||
|
update_wiki()
|
||||||
|
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue