buildbot: update client

This commit is contained in:
JerryXiao 2019-09-08 14:06:30 +08:00
parent f23d480acb
commit 95d4587cb0
2 changed files with 10 additions and 6 deletions

View file

@ -54,10 +54,10 @@ if __name__ == '__main__':
actions = { actions = {
'info': 'show buildbot info', 'info': 'show buildbot info',
'update': '[--overwrite] update pushed files to the repo', 'update': '[--overwrite] update pushed files to the repo',
'clean': '[dir / all] checkout pkgbuilds in packages', 'clean': '[dir / all] checkout pkgbuilds in packages',
'rebuild': '[dir1 dir2 --clean] rebuild packages', 'rebuild': '[dir1 dir2 --clean] rebuild packages',
'log': '[--debug] print log', 'log': '[--debug] print log',
'upload': '[dir1 dir2] force upload packages', 'upload': '[dir1 dir2 --overwrite] force upload packages',
'getup': 'check for updates now' 'getup': 'check for updates now'
} }
parser = argparse.ArgumentParser(description='Client for buildbot', parser = argparse.ArgumentParser(description='Client for buildbot',
@ -86,7 +86,7 @@ if __name__ == '__main__':
logger.info(run('getup', server=server)) logger.info(run('getup', server=server))
elif action[0] == 'update': elif action[0] == 'update':
server=(REPOD_BIND_ADDRESS, REPOD_BIND_PASSWD) server=(REPOD_BIND_ADDRESS, REPOD_BIND_PASSWD)
logger.info(run('update', kwargs={'overwrite': False}, server=server)) logger.info(run('update', kwargs={'overwrite': args.overwrite}, server=server))
elif action[0] == 'clean': elif action[0] == 'clean':
if len(action) <= 1: if len(action) <= 1:
print('Error: Need package name') print('Error: Need package name')

View file

@ -6,6 +6,7 @@
import logging import logging
from utils import background, print_exc_plus, configure_logger from utils import background, print_exc_plus, configure_logger
import subprocess
logger = logging.getLogger(f'buildbot.{__name__}') logger = logging.getLogger(f'buildbot.{__name__}')
@ -13,4 +14,7 @@ logger = logging.getLogger(f'buildbot.{__name__}')
# does nothing # does nothing
@background @background
def send(content): def send(content):
pass try:
subprocess.run(['python', 'tgapi.py', str(content)], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
except:
pass