2011-03-21 16:46:26 +00:00
|
|
|
# -*- python -*-
|
|
|
|
# ex: set syntax=python:
|
|
|
|
|
2011-03-27 05:23:14 +00:00
|
|
|
# <pep8 compliant>
|
|
|
|
|
2014-11-08 19:11:50 +00:00
|
|
|
# List of the branches being built automatically overnight
|
2015-08-05 09:45:52 +00:00
|
|
|
NIGHT_SCHEDULE_BRANCHES = [None]
|
2014-11-08 19:11:50 +00:00
|
|
|
|
|
|
|
# List of the branches available for force build
|
2015-01-29 04:35:06 +00:00
|
|
|
FORCE_SCHEDULE_BRANCHES = ["master", "gooseberry", "experimental-build"]
|
2014-11-08 19:11:50 +00:00
|
|
|
|
2014-07-20 12:00:39 +00:00
|
|
|
"""
|
|
|
|
Stock Twisted directory lister doesn't provide any information about last file
|
|
|
|
modification time, we hack the class a bit in order to have such functionaliity
|
|
|
|
:)
|
|
|
|
"""
|
|
|
|
|
|
|
|
from buildbot.status.web.base import DirectoryLister
|
|
|
|
|
2015-01-29 04:35:06 +00:00
|
|
|
|
2014-07-20 12:00:39 +00:00
|
|
|
def get_files_and_directories(self, directory):
|
|
|
|
from twisted.web.static import (getTypeAndEncoding,
|
|
|
|
formatFileSize)
|
|
|
|
import urllib
|
|
|
|
import cgi
|
|
|
|
import time
|
|
|
|
import os
|
|
|
|
files = []
|
|
|
|
dirs = []
|
|
|
|
for path in directory:
|
|
|
|
url = urllib.quote(path, "/")
|
|
|
|
escapedPath = cgi.escape(path)
|
|
|
|
lastmodified = time.ctime(os.path.getmtime(
|
|
|
|
os.path.join(self.path, path)))
|
|
|
|
if os.path.isdir(os.path.join(self.path, path)):
|
|
|
|
url = url + '/'
|
|
|
|
dirs.append({'text': escapedPath + "/", 'href': url,
|
|
|
|
'size': '', 'type': '[Directory]',
|
|
|
|
'encoding': '',
|
|
|
|
'lastmodified': lastmodified})
|
|
|
|
else:
|
|
|
|
mimetype, encoding = getTypeAndEncoding(path, self.contentTypes,
|
|
|
|
self.contentEncodings,
|
|
|
|
self.defaultType)
|
|
|
|
try:
|
|
|
|
size = os.stat(os.path.join(self.path, path)).st_size
|
|
|
|
except OSError:
|
|
|
|
continue
|
|
|
|
files.append({
|
|
|
|
'text': escapedPath, "href": url,
|
|
|
|
'type': '[%s]' % mimetype,
|
|
|
|
'encoding': (encoding and '[%s]' % encoding or ''),
|
|
|
|
'size': formatFileSize(size),
|
|
|
|
'lastmodified': lastmodified})
|
|
|
|
return dirs, files
|
|
|
|
DirectoryLister._getFilesAndDirectories = get_files_and_directories
|
|
|
|
|
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
|
2013-11-19 12:52:18 +00:00
|
|
|
from buildbot.changes.gitpoller import GitPoller
|
2011-03-21 16:46:26 +00:00
|
|
|
|
2013-11-19 12:52:18 +00:00
|
|
|
c['change_source'] = GitPoller(
|
|
|
|
'git://git.blender.org/blender.git',
|
2013-06-01 10:18:47 +00:00
|
|
|
pollinterval=1200)
|
|
|
|
|
2014-07-23 16:00:46 +00:00
|
|
|
|
|
|
|
# CODEBASES
|
|
|
|
#
|
2016-03-31 23:02:59 +00:00
|
|
|
# Allow to control separately things like branches for each repo and submodules.
|
2014-07-23 16:00:46 +00:00
|
|
|
|
|
|
|
all_repositories = {
|
|
|
|
r'git://git.blender.org/blender.git': 'blender',
|
|
|
|
r'git://git.blender.org/blender-translations.git': 'blender-translations',
|
|
|
|
r'git://git.blender.org/blender-addons.git': 'blender-addons',
|
|
|
|
r'git://git.blender.org/blender-addons-contrib.git': 'blender-addons-contrib',
|
2014-07-23 17:34:30 +00:00
|
|
|
r'https://svn.blender.org/svnroot/bf-blender/': 'lib svn',
|
2014-07-23 16:00:46 +00:00
|
|
|
}
|
|
|
|
|
2015-01-29 04:35:06 +00:00
|
|
|
|
2014-07-23 16:00:46 +00:00
|
|
|
def codebaseGenerator(chdict):
|
|
|
|
return all_repositories[chdict['repository']]
|
|
|
|
|
|
|
|
c['codebaseGenerator'] = codebaseGenerator
|
|
|
|
|
|
|
|
|
2013-06-01 10:18:47 +00:00
|
|
|
# SCHEDULERS
|
|
|
|
#
|
|
|
|
# Decide how to react to incoming changes.
|
|
|
|
|
|
|
|
# from buildbot.scheduler import Scheduler
|
2014-07-20 12:00:39 +00:00
|
|
|
from buildbot.schedulers import timed, forcesched
|
2013-06-01 10:18:47 +00:00
|
|
|
|
|
|
|
c['schedulers'] = []
|
|
|
|
|
2015-01-29 04:35:06 +00:00
|
|
|
|
2014-07-20 12:00:39 +00:00
|
|
|
def schedule_force_build(name):
|
|
|
|
c['schedulers'].append(forcesched.ForceScheduler(name='force ' + name,
|
|
|
|
builderNames=[name],
|
2014-07-23 16:00:46 +00:00
|
|
|
codebases=[forcesched.CodebaseParameter(
|
|
|
|
codebase="blender",
|
|
|
|
branch=forcesched.ChoiceStringParameter(
|
2014-11-08 19:11:50 +00:00
|
|
|
name="branch", choices=FORCE_SCHEDULE_BRANCHES, default="master"),
|
2014-07-23 16:00:46 +00:00
|
|
|
# Do not hide revision, can be handy!
|
|
|
|
repository=forcesched.FixedParameter(name="repository", default="", hide=True),
|
|
|
|
project=forcesched.FixedParameter(name="project", default="", hide=True)),
|
|
|
|
# For now, hide other codebases.
|
|
|
|
forcesched.CodebaseParameter(hide=True, codebase="blender-translations"),
|
|
|
|
forcesched.CodebaseParameter(hide=True, codebase="blender-addons"),
|
|
|
|
forcesched.CodebaseParameter(hide=True, codebase="blender-addons-contrib"),
|
2014-07-23 17:34:30 +00:00
|
|
|
forcesched.CodebaseParameter(hide=True, codebase="lib svn")],
|
2014-07-22 02:03:15 +00:00
|
|
|
properties=[]))
|
2014-07-20 12:00:39 +00:00
|
|
|
|
|
|
|
|
2013-06-01 10:18:47 +00:00
|
|
|
def schedule_build(name, hour, minute=0):
|
2014-11-08 19:11:50 +00:00
|
|
|
for current_branch in NIGHT_SCHEDULE_BRANCHES:
|
|
|
|
scheduler_name = "nightly " + name
|
|
|
|
if current_branch:
|
|
|
|
scheduler_name += ' ' + current_branch
|
|
|
|
c['schedulers'].append(timed.Nightly(name=scheduler_name,
|
|
|
|
codebases={
|
|
|
|
"blender": {"repository": ""},
|
|
|
|
"blender-translations": {"repository": "", "branch": "master"},
|
|
|
|
"blender-addons": {"repository": "", "branch": "master"},
|
|
|
|
"blender-addons-contrib": {"repository": "", "branch": "master"},
|
2015-02-10 08:47:28 +00:00
|
|
|
"lib svn": {"repository": "", "branch": "trunk"}},
|
2014-11-08 19:11:50 +00:00
|
|
|
branch=current_branch,
|
|
|
|
builderNames=[name],
|
|
|
|
hour=hour,
|
|
|
|
minute=minute))
|
2013-06-01 10:18:47 +00:00
|
|
|
|
2011-03-21 16:46:26 +00:00
|
|
|
|
|
|
|
# BUILDERS
|
|
|
|
#
|
2014-07-20 12:00:39 +00:00
|
|
|
# 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.
|
2011-03-21 16:46:26 +00:00
|
|
|
|
|
|
|
from buildbot.process.factory import BuildFactory
|
2014-07-23 20:33:37 +00:00
|
|
|
from buildbot.process.properties import Interpolate
|
2011-03-27 05:23:14 +00:00
|
|
|
from buildbot.steps.source import SVN
|
2013-11-19 12:52:18 +00:00
|
|
|
from buildbot.steps.source import Git
|
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
|
|
|
|
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
|
|
|
|
2014-07-20 12:00:39 +00:00
|
|
|
def add_builder(c, name, libdir, factory, branch='',
|
|
|
|
rsync=False, hour=3, minute=0):
|
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)
|
2014-07-20 12:00:39 +00:00
|
|
|
c['builders'].append(BuilderConfig(name=name,
|
|
|
|
slavenames=slavenames,
|
|
|
|
factory=f,
|
|
|
|
category='blender'))
|
2011-03-22 13:05:05 +00:00
|
|
|
buildernames.append(name)
|
2011-03-21 16:46:26 +00:00
|
|
|
|
2013-06-01 10:18:47 +00:00
|
|
|
schedule_build(name, hour, minute)
|
2014-07-20 12:00:39 +00:00
|
|
|
schedule_force_build(name)
|
2013-06-01 10:18:47 +00:00
|
|
|
|
2011-03-21 16:46:26 +00:00
|
|
|
# common steps
|
|
|
|
|
2014-07-20 12:00:39 +00:00
|
|
|
|
2013-11-19 12:52:18 +00:00
|
|
|
def git_submodule_step(submodule):
|
2014-07-20 12:00:39 +00:00
|
|
|
return Git(name=submodule + '.git',
|
|
|
|
repourl='git://git.blender.org/' + submodule + '.git',
|
|
|
|
mode='update',
|
2014-07-23 16:00:46 +00:00
|
|
|
codebase=submodule,
|
2014-07-20 12:00:39 +00:00
|
|
|
workdir=submodule + '.git')
|
|
|
|
|
2011-03-27 05:23:14 +00:00
|
|
|
|
2013-11-19 12:52:18 +00:00
|
|
|
def git_step(branch=''):
|
2011-06-03 20:44:23 +00:00
|
|
|
if branch:
|
2014-07-20 12:00:39 +00:00
|
|
|
return Git(name='blender.git',
|
|
|
|
repourl='git://git.blender.org/blender.git',
|
|
|
|
mode='update',
|
|
|
|
branch=branch,
|
2014-07-23 16:00:46 +00:00
|
|
|
codebase='blender',
|
2014-07-20 12:00:39 +00:00
|
|
|
workdir='blender.git',
|
|
|
|
submodules=True)
|
2011-06-03 20:44:23 +00:00
|
|
|
else:
|
2014-07-20 12:00:39 +00:00
|
|
|
return Git(name='blender.git',
|
|
|
|
repourl='git://git.blender.org/blender.git',
|
|
|
|
mode='update',
|
2014-07-23 16:00:46 +00:00
|
|
|
codebase='blender',
|
2014-07-20 12:00:39 +00:00
|
|
|
workdir='blender.git',
|
|
|
|
submodules=True)
|
|
|
|
|
2013-11-19 12:52:18 +00:00
|
|
|
|
|
|
|
def git_submodules_update():
|
2014-07-20 12:00:39 +00:00
|
|
|
command = ['git', 'submodule', 'foreach', '--recursive',
|
|
|
|
'git', 'pull', 'origin', 'master']
|
|
|
|
return ShellCommand(name='Submodules Update',
|
|
|
|
command=command,
|
|
|
|
description='updating',
|
|
|
|
descriptionDone='up to date',
|
|
|
|
workdir='blender.git')
|
|
|
|
|
2011-03-27 05:23:14 +00:00
|
|
|
|
2012-10-28 16:40:31 +00:00
|
|
|
def lib_svn_step(dir):
|
2014-07-20 12:00:39 +00:00
|
|
|
return SVN(name='lib svn',
|
|
|
|
baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/lib/' + dir,
|
2014-07-23 17:34:30 +00:00
|
|
|
codebase='lib svn',
|
2014-07-20 12:00:39 +00:00
|
|
|
mode='update',
|
|
|
|
defaultBranch='trunk',
|
|
|
|
workdir='lib/' + dir)
|
|
|
|
|
2011-06-21 17:17:51 +00:00
|
|
|
|
2012-11-18 00:20:23 +00:00
|
|
|
def rsync_step(id, branch, rsync_script):
|
2014-07-20 12:00:39 +00:00
|
|
|
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):
|
2014-07-23 20:28:02 +00:00
|
|
|
filename = 'uploaded/buildbot_upload_' + id + '.zip'
|
2013-11-19 12:52:18 +00:00
|
|
|
compile_script = '../blender.git/build_files/buildbot/slave_compile.py'
|
|
|
|
test_script = '../blender.git/build_files/buildbot/slave_test.py'
|
|
|
|
pack_script = '../blender.git/build_files/buildbot/slave_pack.py'
|
|
|
|
rsync_script = '../blender.git/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()
|
2013-11-25 09:24:09 +00:00
|
|
|
if libdir != '':
|
|
|
|
f.addStep(lib_svn_step(libdir))
|
|
|
|
|
2014-07-20 12:00:39 +00:00
|
|
|
for submodule in ('blender-translations',
|
|
|
|
'blender-addons',
|
Remove SCons building system
While SCons building system was serving us really good for ages it's no longer
having much attention by the developers and started to become quite a difficult
task to maintain.
What's even worse -- there started to be quite serious divergence between SCons
and CMake which was only accumulating over the releases now. The fact that none
of the active developers are really using SCons and that our main studio is also
using CMake spotting bugs in the SCons builds became quite a difficult task and
we aren't always spotting them in time.
Meanwhile CMake became really mature building system which is available on every
platform we support and arguably it's also easier and more robust to use.
This commit includes:
- Removal of actual SCons building system
- Removal of SCons git submodule
- Removal of documentation which is stored in the sources and covers SCons
- Tweaks to the buildbot master to stop using SCons submodule
(this change requires deploying to the server)
- Tweaks to the install dependencies script to skip installing or mentioning
SCons building system
- Tweaks to various helper scripts to avoid mention of SCons folders/files
as well
Reviewers: mont29, dingto, dfelinto, lukastoenne, lukasstockner97, brecht, Severin, merwin, aligorith, psy-fi, campbellbarton, juicyfruit
Reviewed By: campbellbarton, juicyfruit
Differential Revision: https://developer.blender.org/D1680
2016-01-04 09:20:48 +00:00
|
|
|
'blender-addons-contrib'):
|
2013-11-19 12:52:18 +00:00
|
|
|
f.addStep(git_submodule_step(submodule))
|
2014-07-20 12:00:39 +00:00
|
|
|
|
2013-11-19 12:52:18 +00:00
|
|
|
f.addStep(git_step(branch))
|
|
|
|
f.addStep(git_submodules_update())
|
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]))
|
2014-07-20 12:00:39 +00:00
|
|
|
f.addStep(ShellCommand(name='package',
|
2014-07-23 20:33:37 +00:00
|
|
|
command=['python', pack_script, id, branch or Interpolate('%(src:blender:branch)s')],
|
2014-07-20 12:00:39 +00:00
|
|
|
description='packaging',
|
|
|
|
descriptionDone='packaged'))
|
2012-10-28 16:40:31 +00:00
|
|
|
if rsync:
|
2014-07-23 20:28:02 +00:00
|
|
|
f.addStep(rsync_step(id, branch, rsync_script))
|
2011-03-22 15:25:18 +00:00
|
|
|
else:
|
2014-07-20 12:00:39 +00:00
|
|
|
f.addStep(FileUpload(name='upload',
|
|
|
|
slavesrc='buildbot_upload.zip',
|
|
|
|
masterdest=filename,
|
|
|
|
maxsize=150 * 1024 * 1024,
|
|
|
|
workdir='install'))
|
|
|
|
f.addStep(MasterShellCommand(name='unpack',
|
2016-06-08 10:17:03 +00:00
|
|
|
command=['python2.7', unpack_script, filename],
|
2014-07-20 12:00:39 +00:00
|
|
|
description='unpacking',
|
|
|
|
descriptionDone='unpacked'))
|
2011-03-21 22:37:08 +00:00
|
|
|
return f
|
2011-03-21 16:46:26 +00:00
|
|
|
|
2015-12-20 10:44:53 +00:00
|
|
|
# Builders
|
2011-03-22 15:25:18 +00:00
|
|
|
|
2015-12-20 09:49:54 +00:00
|
|
|
add_builder(c, 'mac_x86_64_10_6_cmake', 'darwin-9.x.universal', generic_builder, hour=5)
|
2016-02-29 10:33:06 +00:00
|
|
|
add_builder(c, 'linux_glibc211_i686_cmake', '', generic_builder, hour=1)
|
2015-12-03 10:19:02 +00:00
|
|
|
add_builder(c, 'linux_glibc211_x86_64_cmake', '', generic_builder, hour=2)
|
2016-02-29 10:33:06 +00:00
|
|
|
add_builder(c, 'linux_glibc219_i686_cmake', '', generic_builder, hour=3)
|
|
|
|
add_builder(c, 'linux_glibc219_x86_64_cmake', '', generic_builder, hour=4)
|
2014-11-08 19:11:50 +00:00
|
|
|
add_builder(c, 'win32_cmake_vc2013', 'windows_vc12', generic_builder, hour=3)
|
|
|
|
add_builder(c, 'win64_cmake_vc2013', 'win64_vc12', generic_builder, hour=4)
|
2016-01-29 12:47:47 +00:00
|
|
|
add_builder(c, 'win64_cmake_vc2015', 'win64_vc14', generic_builder, hour=5)
|
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
|
2013-06-01 10:18:47 +00:00
|
|
|
from buildbot.status.web import auth
|
|
|
|
|
|
|
|
users = []
|
|
|
|
for slave in master_private.slaves:
|
|
|
|
users += [(slave['name'], slave['password'])]
|
2011-03-21 16:46:26 +00:00
|
|
|
|
2011-03-27 05:23:14 +00:00
|
|
|
authz_cfg = authz.Authz(
|
2013-06-01 10:18:47 +00:00
|
|
|
auth=auth.BasicAuth(users),
|
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,
|
2014-07-20 12:00:39 +00:00
|
|
|
forceBuild=True, # use this to test your slave once it is set up
|
2011-03-27 05:23:14 +00:00
|
|
|
forceAllBuilds=False,
|
|
|
|
pingBuilder=False,
|
2014-07-20 12:00:39 +00:00
|
|
|
stopBuild=True,
|
2011-03-27 05:23:14 +00:00
|
|
|
stopAllBuilds=False,
|
2014-07-20 12:00:39 +00:00
|
|
|
cancelPendingBuild=True,
|
2011-03-21 16:46:26 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
|
2016-02-29 10:33:06 +00:00
|
|
|
#c['status'].append(html.WebStatus(http_port=8010))
|
2011-03-21 16:46:26 +00:00
|
|
|
|
|
|
|
# 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"
|