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