2011-03-21 16:46:26 +00:00
|
|
|
# -*- python -*-
|
|
|
|
# ex: set syntax=python:
|
|
|
|
|
2011-03-27 05:23:14 +00:00
|
|
|
# <pep8 compliant>
|
|
|
|
|
2011-03-21 16:46:26 +00:00
|
|
|
# Dictionary that the buildmaster pays attention to.
|
|
|
|
c = BuildmasterConfig = {}
|
|
|
|
|
|
|
|
# BUILD SLAVES
|
|
|
|
#
|
|
|
|
# We load the slaves and their passwords from a separator file, so we can have
|
|
|
|
# this one in SVN.
|
|
|
|
|
|
|
|
from buildbot.buildslave import BuildSlave
|
|
|
|
import master_private
|
|
|
|
|
|
|
|
c['slaves'] = []
|
|
|
|
|
|
|
|
for slave in master_private.slaves:
|
2011-03-21 22:37:08 +00:00
|
|
|
c['slaves'].append(BuildSlave(slave['name'], slave['password']))
|
2011-03-21 16:46:26 +00:00
|
|
|
|
|
|
|
# TCP port through which slaves connect
|
|
|
|
|
|
|
|
c['slavePortnum'] = 9989
|
|
|
|
|
|
|
|
# CHANGE SOURCES
|
|
|
|
|
|
|
|
from buildbot.changes.svnpoller import SVNPoller
|
|
|
|
|
|
|
|
c['change_source'] = SVNPoller(
|
2013-01-15 23:17:45 +00:00
|
|
|
'https://svn.blender.org/svnroot/bf-blender/trunk/',
|
|
|
|
pollinterval=1200)
|
2011-03-21 16:46:26 +00:00
|
|
|
|
|
|
|
# BUILDERS
|
|
|
|
#
|
|
|
|
# The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
|
|
|
|
# what steps, and which slaves can execute them. Note that any particular build will
|
|
|
|
# only take place on one slave.
|
|
|
|
|
|
|
|
from buildbot.process.factory import BuildFactory
|
2011-03-27 05:23:14 +00:00
|
|
|
from buildbot.steps.source import SVN
|
2011-03-21 16:46:26 +00:00
|
|
|
from buildbot.steps.shell import ShellCommand
|
|
|
|
from buildbot.steps.shell import Compile
|
|
|
|
from buildbot.steps.shell import Test
|
|
|
|
from buildbot.steps.transfer import FileUpload
|
2011-03-27 05:23:14 +00:00
|
|
|
# from buildbot.steps.transfer import FileDownload
|
2011-03-21 16:46:26 +00:00
|
|
|
from buildbot.steps.master import MasterShellCommand
|
|
|
|
from buildbot.config import BuilderConfig
|
|
|
|
|
|
|
|
# add builder utility
|
|
|
|
|
|
|
|
c['builders'] = []
|
|
|
|
buildernames = []
|
|
|
|
|
2011-03-27 05:23:14 +00:00
|
|
|
|
2012-10-28 16:40:31 +00:00
|
|
|
def add_builder(c, name, libdir, factory, branch='', rsync=False):
|
2011-03-21 22:37:08 +00:00
|
|
|
slavenames = []
|
|
|
|
|
|
|
|
for slave in master_private.slaves:
|
|
|
|
if name in slave['builders']:
|
|
|
|
slavenames.append(slave['name'])
|
2011-03-21 16:46:26 +00:00
|
|
|
|
2011-03-22 13:05:05 +00:00
|
|
|
if len(slavenames) > 0:
|
2012-10-28 16:40:31 +00:00
|
|
|
f = factory(name, libdir, branch, rsync)
|
2011-03-22 13:05:05 +00:00
|
|
|
c['builders'].append(BuilderConfig(name=name, slavenames=slavenames, factory=f, category='blender'))
|
|
|
|
buildernames.append(name)
|
2011-03-21 16:46:26 +00:00
|
|
|
|
|
|
|
# common steps
|
|
|
|
|
2011-03-27 05:23:14 +00:00
|
|
|
|
2011-06-03 20:44:23 +00:00
|
|
|
def svn_step(branch=''):
|
|
|
|
if branch:
|
|
|
|
return SVN(baseURL='https://svn.blender.org/svnroot/bf-blender/branches/%%BRANCH%%', mode='update', defaultBranch=branch, workdir='blender')
|
|
|
|
else:
|
|
|
|
return SVN(baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/blender', mode='update', defaultBranch='trunk', workdir='blender')
|
2011-03-27 05:23:14 +00:00
|
|
|
|
2013-01-15 23:17:45 +00:00
|
|
|
|
2012-10-28 16:40:31 +00:00
|
|
|
def lib_svn_step(dir):
|
|
|
|
return SVN(name='lib svn', baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/lib/' + dir, mode='update', defaultBranch='trunk', workdir='lib/' + dir)
|
2011-06-21 17:17:51 +00:00
|
|
|
|
2013-01-15 23:17:45 +00:00
|
|
|
|
2012-11-18 00:20:23 +00:00
|
|
|
def rsync_step(id, branch, rsync_script):
|
|
|
|
return ShellCommand(name='rsync', command=['python', rsync_script, id, branch], description='uploading', descriptionDone='uploaded', workdir='install')
|
2011-03-21 22:37:08 +00:00
|
|
|
|
2011-03-22 15:25:18 +00:00
|
|
|
# generic builder
|
2011-03-21 16:46:26 +00:00
|
|
|
|
2011-03-27 05:23:14 +00:00
|
|
|
|
2012-10-28 16:40:31 +00:00
|
|
|
def generic_builder(id, libdir='', branch='', rsync=False):
|
2012-11-18 00:20:23 +00:00
|
|
|
filename = 'uploaded/buildbot_upload_' + id + '.zip'
|
2011-03-22 13:05:05 +00:00
|
|
|
compile_script = '../blender/build_files/buildbot/slave_compile.py'
|
|
|
|
test_script = '../blender/build_files/buildbot/slave_test.py'
|
|
|
|
pack_script = '../blender/build_files/buildbot/slave_pack.py'
|
2012-11-18 00:20:23 +00:00
|
|
|
rsync_script = '../blender/build_files/buildbot/slave_rsync.py'
|
2011-03-22 13:05:05 +00:00
|
|
|
unpack_script = 'master_unpack.py'
|
2011-03-21 22:37:08 +00:00
|
|
|
|
|
|
|
f = BuildFactory()
|
2011-06-03 20:44:23 +00:00
|
|
|
f.addStep(svn_step(branch))
|
2011-03-22 13:05:05 +00:00
|
|
|
if libdir != '':
|
|
|
|
f.addStep(lib_svn_step(libdir))
|
2011-03-21 22:37:08 +00:00
|
|
|
|
2012-11-18 00:20:23 +00:00
|
|
|
f.addStep(Compile(command=['python', compile_script, id], timeout=3600))
|
2012-10-28 16:40:31 +00:00
|
|
|
f.addStep(Test(command=['python', test_script, id]))
|
|
|
|
f.addStep(ShellCommand(name='package', command=['python', pack_script, id, branch], description='packaging', descriptionDone='packaged'))
|
|
|
|
if rsync:
|
2012-11-18 00:20:23 +00:00
|
|
|
f.addStep(rsync_step(id, branch, rsync_script))
|
2012-10-28 16:40:31 +00:00
|
|
|
elif id.find('cmake') != -1:
|
2011-03-27 05:23:14 +00:00
|
|
|
f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=100 * 1024 * 1024))
|
2011-03-22 15:25:18 +00:00
|
|
|
else:
|
2011-03-27 05:23:14 +00:00
|
|
|
f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=100 * 1024 * 1024, workdir='install'))
|
2011-03-22 13:05:05 +00:00
|
|
|
f.addStep(MasterShellCommand(name='unpack', command=['python', unpack_script, filename], description='unpacking', descriptionDone='unpacked'))
|
2011-03-21 22:37:08 +00:00
|
|
|
return f
|
2011-03-21 16:46:26 +00:00
|
|
|
|
2011-03-22 15:25:18 +00:00
|
|
|
# builders
|
|
|
|
|
2012-11-18 00:20:23 +00:00
|
|
|
add_builder(c, 'mac_x86_64_10_6_scons', 'darwin-9.x.universal', generic_builder, '', True)
|
|
|
|
add_builder(c, 'mac_x86_64_10_5_scons', '', generic_builder, '', True)
|
2012-10-28 16:40:31 +00:00
|
|
|
#add_builder(c, 'salad_mac_x86_64_scons', 'darwin-9.x.universal', generic_builder, 'soc-2011-salad')
|
2011-06-03 20:44:23 +00:00
|
|
|
add_builder(c, 'mac_i386_scons', 'darwin-9.x.universal', generic_builder)
|
|
|
|
add_builder(c, 'mac_ppc_scons', 'darwin-9.x.universal', generic_builder)
|
|
|
|
#add_builder(c, 'linux_x86_64_cmake', '', generic_builder)
|
2013-01-09 13:46:59 +00:00
|
|
|
#add_builder(c, 'linux_glibc27_i386_scons', '', generic_builder)
|
2012-10-28 16:58:44 +00:00
|
|
|
add_builder(c, 'linux_glibc211_i386_scons', '', generic_builder)
|
2012-10-28 16:40:31 +00:00
|
|
|
#add_builder(c, 'salad_linux_i386_scons', '', generic_builder, 'soc-2011-salad')
|
2013-01-09 13:46:59 +00:00
|
|
|
#add_builder(c, 'linux_glibc27_x86_64_scons', '', generic_builder)
|
2012-10-28 16:58:44 +00:00
|
|
|
add_builder(c, 'linux_glibc211_x86_64_scons', '', generic_builder)
|
2012-10-28 16:40:31 +00:00
|
|
|
#add_builder(c, 'salad_linux_x86_64_scons', '', generic_builder, 'soc-2011-salad')
|
2011-03-22 15:25:18 +00:00
|
|
|
add_builder(c, 'win32_scons', 'windows', generic_builder)
|
2012-10-28 16:40:31 +00:00
|
|
|
#add_builder(c, 'salad_win32_scons', 'windows', generic_builder, 'soc-2011-salad')
|
2011-08-11 16:43:36 +00:00
|
|
|
add_builder(c, 'win64_scons', 'win64', generic_builder)
|
2012-04-27 13:18:55 +00:00
|
|
|
add_builder(c, 'mingw_win32_scons', 'mingw32', generic_builder)
|
2012-10-28 16:40:31 +00:00
|
|
|
add_builder(c, 'mingw_win64_scons', 'mingw64', generic_builder)
|
2011-06-03 20:44:23 +00:00
|
|
|
#add_builder(c, 'freebsd_i386_cmake', '', generic_builder)
|
|
|
|
#add_builder(c, 'freebsd_x86_64_cmake', '', generic_builder)
|
2011-03-21 16:46:26 +00:00
|
|
|
|
|
|
|
# SCHEDULERS
|
|
|
|
#
|
|
|
|
# Decide how to react to incoming changes.
|
|
|
|
|
2011-03-27 05:23:14 +00:00
|
|
|
# from buildbot.scheduler import Scheduler
|
2011-03-21 16:46:26 +00:00
|
|
|
from buildbot.schedulers import timed
|
|
|
|
|
|
|
|
c['schedulers'] = []
|
|
|
|
#c['schedulers'].append(Scheduler(name="all", branch=None,
|
|
|
|
# treeStableTimer=None,
|
|
|
|
# builderNames=[]))
|
|
|
|
#c['schedulers'].append(timed.Periodic(name="nightly",
|
2011-03-21 22:37:08 +00:00
|
|
|
# builderNames=buildernames,
|
|
|
|
# periodicBuildTimer=24*60*60))
|
2011-03-21 16:46:26 +00:00
|
|
|
|
2012-10-28 16:40:31 +00:00
|
|
|
schedule_cycle = 4
|
|
|
|
|
|
|
|
for i in range(0, schedule_cycle):
|
|
|
|
names = []
|
|
|
|
for j in range(0, len(buildernames)):
|
|
|
|
if j % schedule_cycle == i:
|
|
|
|
names += [buildernames[j]]
|
|
|
|
|
|
|
|
print(names)
|
|
|
|
c['schedulers'].append(timed.Nightly(name='nightly' + str(i),
|
2013-01-15 23:17:45 +00:00
|
|
|
builderNames=names,
|
|
|
|
hour=3 + i,
|
|
|
|
minute=0))
|
2011-03-21 16:46:26 +00:00
|
|
|
|
|
|
|
# STATUS TARGETS
|
|
|
|
#
|
|
|
|
# 'status' is a list of Status Targets. The results of each build will be
|
|
|
|
# pushed to these targets. buildbot/status/*.py has a variety to choose from,
|
|
|
|
# including web pages, email senders, and IRC bots.
|
|
|
|
|
|
|
|
c['status'] = []
|
|
|
|
|
|
|
|
from buildbot.status import html
|
2011-03-27 05:23:14 +00:00
|
|
|
from buildbot.status.web import authz
|
2011-03-21 16:46:26 +00:00
|
|
|
|
2011-03-27 05:23:14 +00:00
|
|
|
authz_cfg = authz.Authz(
|
2011-03-21 16:46:26 +00:00
|
|
|
# change any of these to True to enable; see the manual for more
|
|
|
|
# options
|
2011-03-27 05:23:14 +00:00
|
|
|
gracefulShutdown=False,
|
|
|
|
forceBuild=True, # use this to test your slave once it is set up
|
|
|
|
forceAllBuilds=False,
|
|
|
|
pingBuilder=False,
|
2012-10-28 16:40:31 +00:00
|
|
|
stopBuild=True,
|
2011-03-27 05:23:14 +00:00
|
|
|
stopAllBuilds=False,
|
2011-06-03 20:44:23 +00:00
|
|
|
cancelPendingBuild=True,
|
2011-03-21 16:46:26 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
|
|
|
|
|
|
|
|
# PROJECT IDENTITY
|
|
|
|
|
|
|
|
c['projectName'] = "Blender"
|
|
|
|
c['projectURL'] = "http://www.blender.org"
|
|
|
|
|
|
|
|
# the 'buildbotURL' string should point to the location where the buildbot's
|
|
|
|
# internal web server (usually the html.WebStatus page) is visible. This
|
|
|
|
# typically uses the port number set in the Waterfall 'status' entry, but
|
|
|
|
# with an externally-visible host name which the buildbot cannot figure out
|
|
|
|
# without some help.
|
|
|
|
|
|
|
|
c['buildbotURL'] = "http://builder.blender.org/"
|
|
|
|
|
|
|
|
# DB URL
|
|
|
|
#
|
|
|
|
# This specifies what database buildbot uses to store change and scheduler
|
|
|
|
# state. You can leave this at its default for all but the largest
|
|
|
|
# installations.
|
|
|
|
|
|
|
|
c['db_url'] = "sqlite:///state.sqlite"
|