Mercurial > hg > autobot
view autobot/template/restart_buildbot.py @ 294:45fd58949f8a
STUB: autobot/projects/__init__.py autobot/template.py
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 11 May 2014 04:30:57 -0700 |
parents | 2cda5a640ae7 |
children | aec0a7f8c191 |
line wrap: on
line source
#!/usr/bin/env python """(re)start the buildbot""" import optparse import os import sys from subprocess import call from time import sleep here = os.path.abspath(os.path.dirname(sys.argv[0])) debug = {{debug}} def main(args=sys.argv[1:]): # parse command line options usage = '%prog [options]' parser = optparse.OptionParser(usage=usage, description=__doc__) parser.add_option('--stop', dest='stop', action='store_true', default=False, help="stop the buildbot only") # could force a build here # buildbot sendchange ... options, args = parser.parse_args(args) # cleanup if debug: call(['rm', '-f', 'master/twistd.log'], cwd=here) call(['rm', '-f', 'slave/twistd.log'], cwd=here) call(['rm', '-rf', 'slave/full'], cwd=here) # stop running instance call(['buildbot', 'stop', 'master'], cwd=here) call(['buildslave', 'stop', 'slave'], cwd=here) # start new instance if not options.stop: call(['buildbot', 'start', 'master'], cwd=here) call(['buildslave', 'start', 'slave'], cwd=here) if __name__ == '__main__': main()