Merged changes in the trunk up to revision 42116.
[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, 'freebsd_i386_cmake', '', generic_builder)
121 #add_builder(c, 'freebsd_x86_64_cmake', '', generic_builder)
122
123 # SCHEDULERS
124 #
125 # Decide how to react to incoming changes.
126
127 # from buildbot.scheduler import Scheduler
128 from buildbot.schedulers import timed
129
130 c['schedulers'] = []
131 #c['schedulers'].append(Scheduler(name="all", branch=None,
132 #                                 treeStableTimer=None,
133 #                                 builderNames=[]))
134 #c['schedulers'].append(timed.Periodic(name="nightly",
135 #                        builderNames=buildernames,
136 #                        periodicBuildTimer=24*60*60))
137
138 c['schedulers'].append(timed.Nightly(name='nightly',
139     builderNames=buildernames,
140     hour=3,
141     minute=0))
142
143 # STATUS TARGETS
144 #
145 # 'status' is a list of Status Targets. The results of each build will be
146 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
147 # including web pages, email senders, and IRC bots.
148
149 c['status'] = []
150
151 from buildbot.status import html
152 from buildbot.status.web import authz
153
154 authz_cfg = authz.Authz(
155     # change any of these to True to enable; see the manual for more
156     # options
157     gracefulShutdown=False,
158     forceBuild=True,  # use this to test your slave once it is set up
159     forceAllBuilds=False,
160     pingBuilder=False,
161     stopBuild=False,
162     stopAllBuilds=False,
163     cancelPendingBuild=True,
164 )
165
166 c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
167
168 # PROJECT IDENTITY
169
170 c['projectName'] = "Blender"
171 c['projectURL'] = "http://www.blender.org"
172
173 # the 'buildbotURL' string should point to the location where the buildbot's
174 # internal web server (usually the html.WebStatus page) is visible. This
175 # typically uses the port number set in the Waterfall 'status' entry, but
176 # with an externally-visible host name which the buildbot cannot figure out
177 # without some help.
178
179 c['buildbotURL'] = "http://builder.blender.org/"
180
181 # DB URL
182 #
183 # This specifies what database buildbot uses to store change and scheduler
184 # state.  You can leave this at its default for all but the largest
185 # installations.
186
187 c['db_url'] = "sqlite:///state.sqlite"