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