phase1: maketag.sh: write version and version.date files as well
[buildbot.git] / phase2 / buildbot.tac
1
2 import os
3
4 from twisted.application import service
5 from buildbot.master import BuildMaster
6
7 basedir = r'.'
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 buildmaster
17 # directory; do not edit it.
18 application = service.Application('buildmaster')
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 configfile = r'master.cfg'
31
32 m = BuildMaster(basedir, configfile)
33 m.setServiceParent(application)
34 m.log_rotation.rotateLength = rotateLength
35 m.log_rotation.maxRotatedFiles = maxRotatedFiles
36