pep8 cleanup
[blender-staging.git] / build_files / buildbot / master.cfg
1 # -*- python -*-
2 # ex: set syntax=python:
3
4 # <pep8 compliant>
5
6 # Dictionary that the buildmaster pays attention to.
7 c = BuildmasterConfig = {}
8
9 # BUILD SLAVES
10 #
11 # We load the slaves and their passwords from a separator file, so we can have
12 # this one in SVN.
13
14 from buildbot.buildslave import BuildSlave
15 import master_private
16
17 c['slaves'] = []
18
19 for slave in master_private.slaves:
20     c['slaves'].append(BuildSlave(slave['name'], slave['password']))
21
22 # TCP port through which slaves connect
23
24 c['slavePortnum'] = 9989
25
26 # CHANGE SOURCES
27
28 from buildbot.changes.svnpoller import SVNPoller
29
30 c['change_source'] = SVNPoller(
31        'https://svn.blender.org/svnroot/bf-blender/trunk/',
32        pollinterval=1200)
33
34 # BUILDERS
35 #
36 # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
37 # what steps, and which slaves can execute them.  Note that any particular build will
38 # only take place on one slave.
39
40 from buildbot.process.factory import BuildFactory
41 from buildbot.steps.source import SVN
42 from buildbot.steps.shell import ShellCommand
43 from buildbot.steps.shell import Compile
44 from buildbot.steps.shell import Test
45 from buildbot.steps.transfer import FileUpload
46 # from buildbot.steps.transfer import FileDownload
47 from buildbot.steps.master import MasterShellCommand
48 from buildbot.config import BuilderConfig
49
50 # add builder utility
51
52 c['builders'] = []
53 buildernames = []
54
55
56 def add_builder(c, name, libdir, factory):
57     slavenames = []
58
59     for slave in master_private.slaves:
60         if name in slave['builders']:
61             slavenames.append(slave['name'])
62
63     if len(slavenames) > 0:
64         f = factory(name, libdir)
65         c['builders'].append(BuilderConfig(name=name, slavenames=slavenames, factory=f, category='blender'))
66         buildernames.append(name)
67
68 # common steps
69
70
71 def svn_step():
72     return SVN(baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/blender', mode='update', defaultBranch='trunk', workdir='blender')
73
74
75 def lib_svn_step(dir):
76     return SVN(name='lib svn', baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/lib/' + dir, mode='update', defaultBranch='trunk', workdir='lib/' + dir)
77
78 # generic builder
79
80
81 def generic_builder(id, libdir=""):
82     filename = 'buildbot_upload_' + id + '.zip'
83     compile_script = '../blender/build_files/buildbot/slave_compile.py'
84     test_script = '../blender/build_files/buildbot/slave_test.py'
85     pack_script = '../blender/build_files/buildbot/slave_pack.py'
86     unpack_script = 'master_unpack.py'
87
88     f = BuildFactory()
89     f.addStep(svn_step())
90     if libdir != '':
91         f.addStep(lib_svn_step(libdir))
92
93     f.addStep(Compile(command=['python', compile_script, id]))
94     f.addStep(Test(command=['python', test_script, id]))
95     f.addStep(ShellCommand(name='package', command=['python', pack_script, id], description='packaging', descriptionDone='packaged'))
96     if id.find('cmake') != -1:
97         f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=100 * 1024 * 1024))
98     else:
99         f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=100 * 1024 * 1024, workdir='install'))
100     f.addStep(MasterShellCommand(name='unpack', command=['python', unpack_script, filename], description='unpacking', descriptionDone='unpacked'))
101     return f
102
103 # builders
104
105 add_builder(c, 'mac_x86_64_cmake', 'darwin-9.x.universal', generic_builder)
106 add_builder(c, 'mac_i386_cmake', 'darwin-9.x.universal', generic_builder)
107 add_builder(c, 'mac_ppc_cmake', 'darwin-9.x.universal', generic_builder)
108 add_builder(c, 'linux_x86_64_cmake', '', generic_builder)
109 add_builder(c, 'linux_x86_64_scons', '', generic_builder)
110 add_builder(c, 'win32_scons', 'windows', generic_builder)
111
112 # SCHEDULERS
113 #
114 # Decide how to react to incoming changes.
115
116 # from buildbot.scheduler import Scheduler
117 from buildbot.schedulers import timed
118
119 c['schedulers'] = []
120 #c['schedulers'].append(Scheduler(name="all", branch=None,
121 #                                 treeStableTimer=None,
122 #                                 builderNames=[]))
123 #c['schedulers'].append(timed.Periodic(name="nightly",
124 #                        builderNames=buildernames,
125 #                        periodicBuildTimer=24*60*60))
126
127 c['schedulers'].append(timed.Nightly(name='nightly',
128     builderNames=buildernames,
129     hour=3,
130     minute=0))
131
132 # STATUS TARGETS
133 #
134 # 'status' is a list of Status Targets. The results of each build will be
135 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
136 # including web pages, email senders, and IRC bots.
137
138 c['status'] = []
139
140 from buildbot.status import html
141 from buildbot.status.web import authz
142
143 authz_cfg = authz.Authz(
144     # change any of these to True to enable; see the manual for more
145     # options
146     gracefulShutdown=False,
147     forceBuild=True,  # use this to test your slave once it is set up
148     forceAllBuilds=False,
149     pingBuilder=False,
150     stopBuild=False,
151     stopAllBuilds=False,
152     cancelPendingBuild=False,
153 )
154
155 c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
156
157 # PROJECT IDENTITY
158
159 c['projectName'] = "Blender"
160 c['projectURL'] = "http://www.blender.org"
161
162 # the 'buildbotURL' string should point to the location where the buildbot's
163 # internal web server (usually the html.WebStatus page) is visible. This
164 # typically uses the port number set in the Waterfall 'status' entry, but
165 # with an externally-visible host name which the buildbot cannot figure out
166 # without some help.
167
168 c['buildbotURL'] = "http://builder.blender.org/"
169
170 # DB URL
171 #
172 # This specifies what database buildbot uses to store change and scheduler
173 # state.  You can leave this at its default for all but the largest
174 # installations.
175
176 c['db_url'] = "sqlite:///state.sqlite"