view worker.tac @ 7:bb8c4f263f94

worker.tac: rename from slave.tac.
author John W. Eaton <jwe@octave.org>
date Fri, 08 Feb 2019 15:47:45 +0000
parents slave.tac@4ad92f00bca5
children
line wrap: on
line source


import os

from buildbot_worker.bot import Worker
from twisted.application import service

basedir = '.'
rotateLength = 10000000
maxRotatedFiles = 10

# if this is a relocatable tac file, get the directory containing the TAC
if basedir == '.':
    import os.path
    basedir = os.path.abspath(os.path.dirname(__file__))

# note: this line is matched against to check that this is a buildbot worker
# directory; do not edit it.
application = service.Application('buildbot-worker')

try:
    from twisted.python.logfile import LogFile
    from twisted.python.log import ILogObserver, FileLogObserver
    logfile = LogFile.fromFullPath(os.path.join(basedir, "twistd.log"), rotateLength=rotateLength,
                                   maxRotatedFiles=maxRotatedFiles)
    application.setComponent(ILogObserver, FileLogObserver(logfile).emit)
except ImportError:
    # probably not yet twisted 8.2.0 and beyond, can't set log yet
    pass

buildmaster_host = 'buildbot.octave.org'
port = 9990
workername = 'your-worker-name'
passwd = 'your-worker-password'
keepalive = 600
maxdelay = 300
numcpus = None
allow_shutdown = None
maxretries = None

s = Worker(buildmaster_host, port, workername, passwd, basedir,
           keepalive, maxdelay=maxdelay,
           numcpus=numcpus, allow_shutdown=allow_shutdown,
           maxRetries=maxretries)
s.setServiceParent(application)