Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
57 lines (43 sloc) 2.06 KB
import os
from twisted.application import service
from import BuildSlave
basedir = r'/var/lib/buildbot/slaves'
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 buildslave
# directory; do not edit it.
application = service.Application('buildslave')
from twisted.python.logfile import LogFile
from twisted.python.log import ILogObserver, FileLogObserver
logfile = LogFile.fromFullPath(os.path.join(basedir, "twistd.log"), rotateLength=rotateLength,
application.setComponent(ILogObserver, FileLogObserver(logfile).emit)
except ImportError:
# probably not yet twisted 8.2.0 and beyond, can't set log yet
# connection data for build master
from ConfigParser import ConfigParser
with open('slave.cfg') as fp:
slave_cfg = ConfigParser()
buildmaster_host = slave_cfg.get('connect', 'buildmaster_host')
port = int(slave_cfg.get('connect', 'port'))
slavename = slave_cfg.get('connect', 'slavename')
passwd = slave_cfg.get('connect', 'passwd')
keepalive = int(slave_cfg.get('connect', 'keepalive'))
maxdelay = int(slave_cfg.get('connect', 'maxdelay'))
usepty = int(slave_cfg.get('local', 'usepty'))
umask = int(slave_cfg.get('local', 'umask'))
# environment variables for commands from master
os.environ['SLAVE_SETUP_CORE'] = '/var/lib/buildbot/slaves/bin/'
os.environ["SLAVE_SETUP_MEASURED"] = "/var/lib/buildbot/slaves/bin/"
os.environ ['SLAVE_SETUP_OPENXT'] = '/var/lib/buildbot/slaves/bin/'
os.environ["SLAVE_SETUP_SELINUX"] = "/var/lib/buildbot/slaves/bin/"
s = BuildSlave(buildmaster_host, port, slavename, passwd, basedir,
keepalive, usepty, umask=umask, maxdelay=maxdelay)
You can’t perform that action at this time.