Merged changes in the trunk up to revision 54802.
[blender.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, branch='', rsync=False):
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, branch, rsync)
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(branch=''):
72     if branch:
73         return SVN(baseURL='https://svn.blender.org/svnroot/bf-blender/branches/%%BRANCH%%', mode='update', defaultBranch=branch, workdir='blender')
74     else:
75         return SVN(baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/blender', mode='update', defaultBranch='trunk', workdir='blender')
76
77
78 def lib_svn_step(dir):
79     return SVN(name='lib svn', baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/lib/' + dir, mode='update', defaultBranch='trunk', workdir='lib/' + dir)
80
81
82 def rsync_step(id, branch, rsync_script):
83     return ShellCommand(name='rsync', command=['python', rsync_script, id, branch], description='uploading', descriptionDone='uploaded', workdir='install')
84
85 # generic builder
86
87
88 def generic_builder(id, libdir='', branch='', rsync=False):
89     filename = 'uploaded/buildbot_upload_' + id + '.zip'
90     compile_script = '../blender/build_files/buildbot/slave_compile.py'
91     test_script = '../blender/build_files/buildbot/slave_test.py'
92     pack_script = '../blender/build_files/buildbot/slave_pack.py'
93     rsync_script = '../blender/build_files/buildbot/slave_rsync.py'
94     unpack_script = 'master_unpack.py'
95
96     f = BuildFactory()
97     f.addStep(svn_step(branch))
98     if libdir != '':
99         f.addStep(lib_svn_step(libdir))
100
101     f.addStep(Compile(command=['python', compile_script, id], timeout=3600))
102     f.addStep(Test(command=['python', test_script, id]))
103     f.addStep(ShellCommand(name='package', command=['python', pack_script, id, branch], description='packaging', descriptionDone='packaged'))
104     if rsync:
105         f.addStep(rsync_step(id, branch, rsync_script))
106     elif id.find('cmake') != -1:
107         f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=100 * 1024 * 1024))
108     else:
109         f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=100 * 1024 * 1024, workdir='install'))
110     f.addStep(MasterShellCommand(name='unpack', command=['python', unpack_script, filename], description='unpacking', descriptionDone='unpacked'))
111     return f
112
113 # builders
114
115 add_builder(c, 'mac_x86_64_10_6_scons', 'darwin-9.x.universal', generic_builder, '', True)
116 add_builder(c, 'mac_x86_64_10_5_scons', '', generic_builder, '', True)
117 #add_builder(c, 'salad_mac_x86_64_scons', 'darwin-9.x.universal', generic_builder, 'soc-2011-salad')
118 add_builder(c, 'mac_i386_scons', 'darwin-9.x.universal', generic_builder)
119 add_builder(c, 'mac_ppc_scons', 'darwin-9.x.universal', generic_builder)
120 #add_builder(c, 'linux_x86_64_cmake', '', generic_builder)
121 #add_builder(c, 'linux_glibc27_i386_scons', '', generic_builder)
122 add_builder(c, 'linux_glibc211_i386_scons', '', generic_builder)
123 #add_builder(c, 'salad_linux_i386_scons', '', generic_builder, 'soc-2011-salad')
124 #add_builder(c, 'linux_glibc27_x86_64_scons', '', generic_builder)
125 add_builder(c, 'linux_glibc211_x86_64_scons', '', generic_builder)
126 #add_builder(c, 'salad_linux_x86_64_scons', '', generic_builder, 'soc-2011-salad')
127 add_builder(c, 'win32_scons', 'windows', generic_builder)
128 #add_builder(c, 'salad_win32_scons', 'windows', generic_builder, 'soc-2011-salad')
129 add_builder(c, 'win64_scons', 'win64', generic_builder)
130 add_builder(c, 'mingw_win32_scons', 'mingw32', generic_builder)
131 add_builder(c, 'mingw_win64_scons', 'mingw64', generic_builder)
132 #add_builder(c, 'freebsd_i386_cmake', '', generic_builder)
133 #add_builder(c, 'freebsd_x86_64_cmake', '', generic_builder)
134
135 # SCHEDULERS
136 #
137 # Decide how to react to incoming changes.
138
139 # from buildbot.scheduler import Scheduler
140 from buildbot.schedulers import timed
141
142 c['schedulers'] = []
143 #c['schedulers'].append(Scheduler(name="all", branch=None,
144 #                                 treeStableTimer=None,
145 #                                 builderNames=[]))
146 #c['schedulers'].append(timed.Periodic(name="nightly",
147 #                        builderNames=buildernames,
148 #                        periodicBuildTimer=24*60*60))
149
150 schedule_cycle = 4
151
152 for i in range(0, schedule_cycle):
153     names = []
154     for j in range(0, len(buildernames)):
155         if j % schedule_cycle == i:
156             names += [buildernames[j]]
157
158     print(names)
159     c['schedulers'].append(timed.Nightly(name='nightly' + str(i),
160                                          builderNames=names,
161                                          hour=3 + i,
162                                          minute=0))
163
164 # STATUS TARGETS
165 #
166 # 'status' is a list of Status Targets. The results of each build will be
167 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
168 # including web pages, email senders, and IRC bots.
169
170 c['status'] = []
171
172 from buildbot.status import html
173 from buildbot.status.web import authz
174
175 authz_cfg = authz.Authz(
176     # change any of these to True to enable; see the manual for more
177     # options
178     gracefulShutdown=False,
179     forceBuild=True,  # use this to test your slave once it is set up
180     forceAllBuilds=False,
181     pingBuilder=False,
182     stopBuild=True,
183     stopAllBuilds=False,
184     cancelPendingBuild=True,
185 )
186
187 c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
188
189 # PROJECT IDENTITY
190
191 c['projectName'] = "Blender"
192 c['projectURL'] = "http://www.blender.org"
193
194 # the 'buildbotURL' string should point to the location where the buildbot's
195 # internal web server (usually the html.WebStatus page) is visible. This
196 # typically uses the port number set in the Waterfall 'status' entry, but
197 # with an externally-visible host name which the buildbot cannot figure out
198 # without some help.
199
200 c['buildbotURL'] = "http://builder.blender.org/"
201
202 # DB URL
203 #
204 # This specifies what database buildbot uses to store change and scheduler
205 # state.  You can leave this at its default for all but the largest
206 # installations.
207
208 c['db_url'] = "sqlite:///state.sqlite"