comparison 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
comparison
equal deleted inserted replaced
6:c8ce098ecc08 7:bb8c4f263f94
1
2 import os
3
4 from buildbot_worker.bot import Worker
5 from twisted.application import service
6
7 basedir = '.'
8 rotateLength = 10000000
9 maxRotatedFiles = 10
10
11 # if this is a relocatable tac file, get the directory containing the TAC
12 if basedir == '.':
13 import os.path
14 basedir = os.path.abspath(os.path.dirname(__file__))
15
16 # note: this line is matched against to check that this is a buildbot worker
17 # directory; do not edit it.
18 application = service.Application('buildbot-worker')
19
20 try:
21 from twisted.python.logfile import LogFile
22 from twisted.python.log import ILogObserver, FileLogObserver
23 logfile = LogFile.fromFullPath(os.path.join(basedir, "twistd.log"), rotateLength=rotateLength,
24 maxRotatedFiles=maxRotatedFiles)
25 application.setComponent(ILogObserver, FileLogObserver(logfile).emit)
26 except ImportError:
27 # probably not yet twisted 8.2.0 and beyond, can't set log yet
28 pass
29
30 buildmaster_host = 'buildbot.octave.org'
31 port = 9990
32 workername = 'your-worker-name'
33 passwd = 'your-worker-password'
34 keepalive = 600
35 maxdelay = 300
36 numcpus = None
37 allow_shutdown = None
38 maxretries = None
39
40 s = Worker(buildmaster_host, port, workername, passwd, basedir,
41 keepalive, maxdelay=maxdelay,
42 numcpus=numcpus, allow_shutdown=allow_shutdown,
43 maxRetries=maxretries)
44 s.setServiceParent(application)
45