Move updating submodules and libraries to script in Blender repository
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 21 Aug 2019 14:11:38 +0000 (16:11 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 3 Sep 2019 12:12:33 +0000 (14:12 +0200)
Ref D5545

master.cfg

index b3c33c610f4c74bffa2ddb46c67510dad9a76cce..eb1375ec8b75b45c9c64d4f61bff18f602b79daa 100644 (file)
@@ -9,12 +9,6 @@ NIGHT_SCHEDULE_BRANCHES = ["master"]
 # List of the branches available for force build
 FORCE_SCHEDULE_BRANCHES = ["master", "experimental-build"]
 
-# List of branches availble for addons branch selection.
-ADDONS_BRANCHES = ["master"]
-
-# List of branches availble for libraries branch selection.
-LIB_BRANCHES = ["trunk"]
-
 # Dictionary that the buildmaster pays attention to.
 c = BuildmasterConfig = {}
 
@@ -50,10 +44,6 @@ c['change_source'] = GitPoller('git://git.blender.org/blender.git',
 
 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',
-    r'git://git.blender.org/blender-dev-tools.git': 'blender-dev-tools',
     r'https://svn.blender.org/svnroot/bf-blender/': 'lib svn',
 }
 
@@ -98,61 +88,6 @@ def schedule_force_build(name):
                     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(
-                       codebase="blender-addons-contrib",
-                       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-dev-tools"),
-                   forcesched.CodebaseParameter(
-                       codebase="lib svn",
-                       branch=forcesched.ChoiceStringParameter(
-                           name="branch",
-                           choices=LIB_BRANCHES,
-                           default="trunk"),
-                       repository=forcesched.FixedParameter(name="repository",
-                                                            default="",
-                                                            hide=True),
-                       project=forcesched.FixedParameter(name="project",
-                                                         default="",
-                                                         hide=True),
-                       revision=forcesched.FixedParameter(name="revision",
-                                                          default="",
-                                                          hide=True),
-                   ),
         ],
         properties=[]))
 
@@ -165,22 +100,11 @@ def schedule_nightly_build(name, hour, minute=0):
         scheduler_name = "nightly_" + name
         if current_branch:
             scheduler_name += ' ' + current_branch
-        addons_branch = "master"
         c['schedulers'].append(timed.Nightly(
             name=scheduler_name,
             codebases={
                 "blender": {"repository": "",
-                            "branch": current_branch},
-                "blender-translations": {"repository": "",
-                                         "branch": "master"},
-                "blender-addons": {"repository": "",
-                                   "branch": addons_branch},
-                "blender-addons-contrib": {"repository": "",
-                                           "branch": addons_branch},
-                "blender-dev-tools": {"repository": "",
-                                      "branch": "master"},
-                "lib svn": {"repository": "",
-                            "branch": "trunk"}},
+                            "branch": current_branch}},
             branch=current_branch,
             builderNames=[name],
             hour=hour,
@@ -209,7 +133,7 @@ c['builders'] = []
 buildernames = []
 
 
-def add_builder(c, name, libdir, factory, branch='',
+def add_builder(c, name, factory, branch='',
                 rsync=False, hour=3, minute=0):
     workernames = []
 
@@ -218,7 +142,7 @@ def add_builder(c, name, libdir, factory, branch='',
             workernames.append(slave['name'])
 
     if workernames:
-        f = factory(name, libdir, branch, rsync)
+        f = factory(name, branch, rsync)
         c['builders'].append(BuilderConfig(name=name,
                                            workernames=workernames,
                                            factory=f,
@@ -231,14 +155,6 @@ def add_builder(c, name, libdir, factory, branch='',
 
 # common steps
 
-def git_submodule_step(submodule):
-    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 steps.Git(name='blender.git',
@@ -257,26 +173,6 @@ def git_step(branch=''):
                          submodules=True)
 
 
-def git_submodules_update():
-    command = ['git', 'submodule', 'update', '--remote']
-    return ShellCommand(name='Submodules Update',
-                        command=command,
-                        description='updating',
-                        descriptionDone='up to date',
-                        workdir='blender.git')
-
-
-def lib_svn_step(dir):
-    # TODO(sergey): For some reason interpolation is always giving empty branch.
-    # lib_repo = 'https://svn.blender.org/svnroot/bf-blender/%(src::branch)s/lib/'
-    lib_repo = 'https://svn.blender.org/svnroot/bf-blender/trunk/lib/'
-    return steps.SVN(name='lib svn ' + dir,
-                     repourl=util.Interpolate(lib_repo + dir),
-                     codebase='lib svn',
-                     mode='incremental',
-                     workdir='lib/' + dir)
-
-
 def rsync_step(python_command, id, branch, rsync_script):
     return ShellCommand(name='rsync',
                         command=[python_command, rsync_script, id, branch],
@@ -287,8 +183,9 @@ def rsync_step(python_command, id, branch, rsync_script):
 
 # generic builder
 
-def generic_builder(id, libdir='', branch='', rsync=False):
+def generic_builder(id, branch='', rsync=False):
     filename = 'uploaded/buildbot_upload_' + id + '.zip'
+    update_script = '../blender.git/build_files/buildbot/slave_update.py'
     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'
@@ -296,24 +193,18 @@ def generic_builder(id, libdir='', branch='', rsync=False):
     unpack_script = 'master_unpack.py'
 
     f = BuildFactory()
-    if libdir != '':
-        f.addStep(lib_svn_step(libdir))
-
     if id.startswith('win'):
         python_command = 'python'
     else:
         python_command = 'python3'
 
-    f.addStep(lib_svn_step('tests'))
-
-    for submodule in ('blender-translations',
-                      'blender-addons',
-                      'blender-addons-contrib',
-                      'blender-dev-tools'):
-        f.addStep(git_submodule_step(submodule))
-
     f.addStep(git_step(branch))
-    f.addStep(git_submodules_update())
+
+    f.addStep(ShellCommand(
+        name='submodules and libraries update',
+        command=[python_command, update_script, id],
+        description='updating',
+        descriptionDone='updated'))
 
     f.addStep(Compile(command=[python_command, compile_script, id], timeout=3600))
     f.addStep(Test(command=[python_command, test_script, id]))
@@ -344,11 +235,11 @@ def generic_builder(id, libdir='', branch='', rsync=False):
 
 # Builders
 
-add_builder(c, 'mac_x86_64_10_9_cmake', 'darwin', generic_builder, hour=1)
-add_builder(c, 'linux_glibc217_x86_64_cmake', '', generic_builder, hour=1)
+add_builder(c, 'mac_x86_64_10_9_cmake', generic_builder, hour=1)
+add_builder(c, 'linux_glibc217_x86_64_cmake', generic_builder, hour=1)
 # NOTE: Visual Studio 2017 (vc15) is using libraries folder from
 # Visual Studio 2015 (vc14)
-add_builder(c, 'win64_cmake_vs2017', 'win64_vc14', generic_builder, hour=1)
+add_builder(c, 'win64_cmake_vs2017', generic_builder, hour=1)
 
 # HORIZONS
 from datetime import timedelta