Cleanup and more plugins enabled
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 12 Jan 2018 14:51:38 +0000 (15:51 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 12 Jan 2018 14:52:20 +0000 (15:52 +0100)
.gitignore
master.cfg

index 54546b0..1c3a481 100644 (file)
@@ -36,8 +36,10 @@ node_modules/
 *.pid
 *.map
 state.sqlite
+master.cfg.sample
 
 # Builders
+workers
 linux_glibc219_i686_cmake
 linux_glibc219_x86_64_cmake
 mac_x86_64_10_6_cmake
index 585bb40..7ee27ba 100644 (file)
@@ -9,6 +9,9 @@ NIGHT_SCHEDULE_BRANCHES = [None, "blender2.8"]
 # List of the branches available for force build
 FORCE_SCHEDULE_BRANCHES = ["master", "blender2.8", "experimental-build"]
 
+# List of branches availble for addons branch selection.
+ADDONS_BRANCHES = ["master", "blender2.8"]
+
 # Dictionary that the buildmaster pays attention to.
 c = BuildmasterConfig = {}
 
@@ -25,8 +28,11 @@ for slave in master_private.slaves:
     c['workers'].append(Worker(slave['name'], slave['password']))
 
 # TCP port through which slaves connect
-c['protocols'] = {'pb': {'port': 9989}}
-
+c['protocols'] = {
+    "pb": {
+        "port": "tcp:{}".format(9989)
+    }
+}
 # CHANGE SOURCES
 
 from buildbot.changes.svnpoller import SVNPoller
@@ -52,6 +58,7 @@ all_repositories = {
 def codebaseGenerator(chdict):
     return all_repositories[chdict['repository']]
 
+
 c['codebaseGenerator'] = codebaseGenerator
 
 
@@ -59,13 +66,16 @@ c['codebaseGenerator'] = codebaseGenerator
 #
 # Decide how to react to incoming changes.
 
-# from buildbot.scheduler import Scheduler
 from buildbot.schedulers import timed, forcesched
 
 c['schedulers'] = []
 
 
 def schedule_force_build(name):
+    """
+    Makes it possible to have "Force Build" for the given builder.
+    Makes sure only reasonabel subset of properties are exposed.
+    """
     c['schedulers'].append(forcesched.ForceScheduler(
         name='force_' + name,
         buttonName="Force Build",
@@ -73,27 +83,54 @@ def schedule_force_build(name):
         codebases=[forcesched.CodebaseParameter(
                 codebase="blender",
                 branch=forcesched.ChoiceStringParameter(
-                    name="branch", choices=FORCE_SCHEDULE_BRANCHES, default="master"),
+                    name="branch",
+                    choices=FORCE_SCHEDULE_BRANCHES,
+                    default="master"),
                 # 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(
-                codebase="blender-addons",
-                branch=forcesched.ChoiceStringParameter(
-                    name="branch", choices=["master", "blender2.8"], default="master"),
-                repository=forcesched.FixedParameter(name="repository", default="", hide=True),
-                project=forcesched.FixedParameter(name="project", default="", hide=True),
-                revision=forcesched.FixedParameter(name="revision", default="", hide=True),
-            ),
-            forcesched.CodebaseParameter(hide=True, codebase="blender-addons-contrib"),
-            forcesched.CodebaseParameter(hide=True, codebase="blender-dev-tools"),
-            forcesched.CodebaseParameter(hide=True, codebase="lib svn")],
+                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(
+                       codebase="blender-addons",
+                       branch=forcesched.ChoiceStringParameter(
+                           name="branch",
+                           choices=ADDONS_BRANCHES,
+                           default="master"),
+                       repository=forcesched.FixedParameter(name="repository",
+                                                            default="",
+                                                            hide=True),
+                       project=forcesched.FixedParameter(name="project",
+                                                         default="",
+                                                         hide=True),
+                       revision=forcesched.FixedParameter(name="revision",
+                                                          default="",
+                                                          hide=True),
+                   ),
+                   forcesched.CodebaseParameter(
+                       hide=True,
+                       codebase="blender-addons-contrib"),
+                   forcesched.CodebaseParameter(
+                       hide=True,
+                       codebase="blender-dev-tools"),
+                   forcesched.CodebaseParameter(
+                       hide=True,
+                       codebase="lib svn")],
         properties=[]))
 
 
-def schedule_build(name, hour, minute=0):
+def schedule_nightly_build(name, hour, minute=0):
+    """
+    Creates scheduler for nightly builds for a given builder.
+    """
     for current_branch in NIGHT_SCHEDULE_BRANCHES:
         scheduler_name = "nightly_" + name
         if current_branch:
@@ -102,14 +139,20 @@ def schedule_build(name, hour, minute=0):
         addons_branch = "master"
         if current_branch == "blender2.8":
             addons_branch = "blender2.8"
-        c['schedulers'].append(timed.Nightly(name=scheduler_name,
+        c['schedulers'].append(timed.Nightly(
+            name=scheduler_name,
             codebases={
                 "blender": {"repository": ""},
-                "blender-translations": {"repository": "", "branch": "master"},
-                "blender-addons": {"repository": "", "branch": addons_branch},
-                "blender-addons-contrib": {"repository": "", "branch": "master"},
-                "blender-dev-tools": {"repository": "", "branch": "master"},
-                "lib svn": {"repository": "", "branch": "trunk"}},
+                "blender-translations": {"repository": "",
+                                         "branch": "master"},
+                "blender-addons": {"repository": "",
+                                   "branch": addons_branch},
+                "blender-addons-contrib": {"repository": "",
+                                           "branch": "master"},
+                "blender-dev-tools": {"repository": "",
+                                      "branch": "master"},
+                "lib svn": {"repository": "",
+                            "branch": "trunk"}},
             branch=current_branch,
             builderNames=[name],
             hour=hour,
@@ -154,11 +197,11 @@ def add_builder(c, name, libdir, factory, branch='',
                                            tags=['blender']))
         buildernames.append(name)
 
-        schedule_build(name, hour, minute)
+        schedule_nightly_build(name, hour, minute)
         schedule_force_build(name)
 
-# common steps
 
+# common steps
 
 def git_submodule_step(submodule):
     return steps.Git(name=submodule + '.git',
@@ -196,8 +239,9 @@ def git_submodules_update():
 
 
 def lib_svn_step(dir):
+    lib_repo = 'https://svn.blender.org/svnroot/bf-blender/%(src::branch)s/lib/'
     return steps.SVN(name='lib svn',
-                     repourl=util.Interpolate('https://svn.blender.org/svnroot/bf-blender/%(src::branch)s/lib/' + dir),
+                     repourl=util.Interpolate(lib_repo + dir),
                      codebase='lib svn',
                      mode='incremental',
                      workdir='lib/' + dir)
@@ -210,8 +254,8 @@ def rsync_step(id, branch, rsync_script):
                         descriptionDone='uploaded',
                         workdir='install')
 
-# generic builder
 
+# generic builder
 
 def generic_builder(id, libdir='', branch='', rsync=False):
     filename = 'uploaded/buildbot_upload_' + id + '.zip'
@@ -236,10 +280,14 @@ def generic_builder(id, libdir='', branch='', rsync=False):
 
     f.addStep(Compile(command=['python', compile_script, id], timeout=3600))
     f.addStep(Test(command=['python', test_script, id]))
-    f.addStep(ShellCommand(name='package',
-                           command=['python', pack_script, id, branch or Interpolate('%(src:blender:branch)s')],
-                           description='packaging',
-                           descriptionDone='packaged'))
+    f.addStep(ShellCommand(
+        name='package',
+        command=['python',
+                 pack_script,
+                 id,
+                 branch or Interpolate('%(src:blender:branch)s')],
+        description='packaging',
+        descriptionDone='packaged'))
     if rsync:
         f.addStep(rsync_step(id, branch, rsync_script))
     else:
@@ -249,11 +297,14 @@ def generic_builder(id, libdir='', branch='', rsync=False):
                              maxsize=180 * 1024 * 1024,
                              workdir='install'))
     f.addStep(MasterShellCommand(name='unpack',
-                                 command=['python2.7', unpack_script, filename],
+                                 command=['python2.7',
+                                          unpack_script,
+                                          filename],
                                  description='unpacking',
                                  descriptionDone='unpacked'))
     return f
 
+
 # Builders
 
 add_builder(c, 'mac_x86_64_10_9_cmake', 'darwin', generic_builder, hour=1)
@@ -264,16 +315,37 @@ 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)
 
+# HORIZONS
+from datetime import timedelta
+
+c['changeHorizon'] = 300
+
+# Configure a janitor which will delete all logs older than one month,
+# and will run on sundays at noon.
+c['configurators'] = [util.JanitorConfigurator(
+    logHorizon=timedelta(weeks=4),
+    hour=12,
+    dayOfWeek=6)]
+
 # WWW
-c['www'] = dict(port=8010)
+c['www'] = dict(port=8010,
+                plugins={'console_view': {},
+                         'grid_view': {},
+                         'waterfall_view': {}})
 
 # PROJECT IDENTITY
 c['projectName'] = "Blender"
-c['projectURL'] = "http://www.blender.org"
+c['projectURL'] = "https://www.blender.org"
 
 # Buildbot information
-c['buildbotURL'] = "http://builder.blender.org/"
+c['buildbotURL'] = "https://builder.blender.org/"
 c['buildbotNetUsageData'] = 'basic'
 
 # Various
 c['db_url'] = "sqlite:///state.sqlite"
+
+c['title'] = "Blender"
+c['titleURL'] = "https://builder.blender.org/"
+
+# Disable sending of 'buildbotNetUsageData' for now, to improve startup time.
+c['buildbotNetUsageData'] = None