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

@ -57,7 +57,7 @@ if __name__ == '__main__':
'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):
try:
subprocess.run(['python', 'tgapi.py', str(content)], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
except:
pass pass