Initial port over 0.9.x branch

This commit is contained in:
2018-01-11 17:10:23 +01:00
parent 653293484b
commit d553752cd0
29 changed files with 55 additions and 3018 deletions

View File

@@ -9,81 +9,31 @@ NIGHT_SCHEDULE_BRANCHES = [None, "blender2.8"]
# List of the branches available for force build
FORCE_SCHEDULE_BRANCHES = ["master", "blender2.8", "experimental-build"]
"""
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
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
# Dictionary that the buildmaster pays attention to.
c = BuildmasterConfig = {}
# BUILD SLAVES
# BUILD WORKERS
#
# We load the slaves and their passwords from a separator file, so we can have
# this one in SVN.
from buildbot.buildslave import BuildSlave
from buildbot.worker import Worker
import master_private
c['slaves'] = []
c['workers'] = []
for slave in master_private.slaves:
c['slaves'].append(BuildSlave(slave['name'], slave['password']))
c['workers'].append(Worker(slave['name'], slave['password']))
# TCP port through which slaves connect
c['slavePortnum'] = 9989
c['protocols'] = {'pb': {'port': 9989}}
# CHANGE SOURCES
from buildbot.changes.svnpoller import SVNPoller
from buildbot.changes.gitpoller import GitPoller
c['change_source'] = GitPoller(
'git://git.blender.org/blender.git',
pollinterval=1200)
c['change_source'] = GitPoller('git://git.blender.org/blender.git',
pollinterval=1200)
# CODEBASES
#
@@ -116,7 +66,7 @@ c['schedulers'] = []
def schedule_force_build(name):
c['schedulers'].append(forcesched.ForceScheduler(name='force ' + name,
c['schedulers'].append(forcesched.ForceScheduler(name='force_' + name,
builderNames=[name],
codebases=[forcesched.CodebaseParameter(
codebase="blender",
@@ -170,16 +120,15 @@ def schedule_build(name, hour, minute=0):
# 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.config import BuilderConfig
from buildbot.plugins import steps, util
from buildbot.process.factory import BuildFactory
from buildbot.process.properties import Interpolate
from buildbot.steps.source import SVN
from buildbot.steps.source import Git
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
@@ -189,18 +138,18 @@ buildernames = []
def add_builder(c, name, libdir, factory, branch='',
rsync=False, hour=3, minute=0):
slavenames = []
workernames = []
for slave in master_private.slaves:
if name in slave['builders']:
slavenames.append(slave['name'])
workernames.append(slave['name'])
if len(slavenames) > 0:
if workernames:
f = factory(name, libdir, branch, rsync)
c['builders'].append(BuilderConfig(name=name,
slavenames=slavenames,
workernames=workernames,
factory=f,
category='blender'))
tags=['blender']))
buildernames.append(name)
schedule_build(name, hour, minute)
@@ -210,29 +159,29 @@ def add_builder(c, name, libdir, factory, branch='',
def git_submodule_step(submodule):
return Git(name=submodule + '.git',
repourl='git://git.blender.org/' + submodule + '.git',
mode='update',
codebase=submodule,
workdir=submodule + '.git')
return steps.Git(name=submodule + '.git',
repourl='git://git.blender.org/' + submodule + '.git',
mode='incremental',
codebase=submodule,
workdir=submodule + '.git')
def git_step(branch=''):
if branch:
return Git(name='blender.git',
repourl='git://git.blender.org/blender.git',
mode='update',
branch=branch,
codebase='blender',
workdir='blender.git',
submodules=True)
return steps.Git(name='blender.git',
repourl='git://git.blender.org/blender.git',
mode='incremental',
branch=branch,
codebase='blender',
workdir='blender.git',
submodules=True)
else:
return Git(name='blender.git',
repourl='git://git.blender.org/blender.git',
mode='update',
codebase='blender',
workdir='blender.git',
submodules=True)
return steps.Git(name='blender.git',
repourl='git://git.blender.org/blender.git',
mode='incremental',
codebase='blender',
workdir='blender.git',
submodules=True)
def git_submodules_update():
@@ -245,12 +194,11 @@ def git_submodules_update():
def lib_svn_step(dir):
return SVN(name='lib svn',
baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/lib/' + dir,
codebase='lib svn',
mode='update',
defaultBranch='trunk',
workdir='lib/' + dir)
return steps.SVN(name='lib svn',
repourl=util.Interpolate('https://svn.blender.org/svnroot/bf-blender/%(src::branch)s/lib/' + dir),
codebase='lib svn',
mode='incremental',
workdir='lib/' + dir)
def rsync_step(id, branch, rsync_script):
@@ -294,7 +242,7 @@ def generic_builder(id, libdir='', branch='', rsync=False):
f.addStep(rsync_step(id, branch, rsync_script))
else:
f.addStep(FileUpload(name='upload',
slavesrc='buildbot_upload.zip',
workersrc='buildbot_upload.zip',
masterdest=filename,
maxsize=180 * 1024 * 1024,
workdir='install'))
@@ -314,55 +262,16 @@ add_builder(c, 'win64_cmake_vc2013', 'win64_vc12', generic_builder, hour=2)
add_builder(c, 'win32_cmake_vc2015', 'windows_vc14', generic_builder, hour=3)
add_builder(c, 'win64_cmake_vc2015', 'win64_vc14', generic_builder, hour=4)
# 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
from buildbot.status.web import authz
from buildbot.status.web import auth
users = []
for slave in master_private.slaves:
users += [(slave['name'], slave['password'])]
authz_cfg = authz.Authz(
auth=auth.BasicAuth(users),
# change any of these to True to enable; see the manual for more
# options
gracefulShutdown=False,
forceBuild=True, # use this to test your slave once it is set up
forceAllBuilds=False,
pingBuilder=False,
stopBuild=True,
stopAllBuilds=False,
cancelPendingBuild=True,
)
c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
#c['status'].append(html.WebStatus(http_port=8010))
# WWW
c['www'] = dict(port=8010)
# 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.
# Buildbot information
c['buildbotURL'] = "http://builder.blender.org/"
c['buildbotNetUsageData'] = 'basic'
# 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.
# Various
c['db_url'] = "sqlite:///state.sqlite"