Bug 437482: Create a bundle of mozilla-central regularly. r=catlee
authorDustin Mitchell <dustin@mozilla.com>
Wed, 24 Nov 2010 09:03:03 -0500
changeset 1087 753e5b87eb6dfa5f5a7a8da92eaf8052d8de3b20
parent 1086 0b84a062f16bfc25cad15f3018de6857a3b9e168
child 1088 94b7596a25231929d514bb0a5102453b5a5b0568
push id717
push usercatlee@mozilla.com
push dateWed, 24 Nov 2010 14:17:44 +0000
reviewerscatlee
bugs437482
Bug 437482: Create a bundle of mozilla-central regularly. r=catlee
misc.py
--- a/misc.py
+++ b/misc.py
@@ -491,16 +491,17 @@ def generateBranchObjects(config, name):
     }
     builders = []
     unittestBuilders = []
     triggeredUnittestBuilders = []
     nightlyBuilders = []
     xulrunnerNightlyBuilders = []
     debugBuilders = []
     weeklyBuilders = []
+    coverageBuilders = []
     # These dicts provides mapping between en-US dep and nightly scheduler names
     # to l10n dep and l10n nightly scheduler names. It's filled out just below here.
     l10nBuilders = {}
     l10nNightlyBuilders = {}
     pollInterval = config.get('pollInterval', 60)
     l10nPollInterval = config.get('l10nPollInterval', 5*60)
     # generate a list of builders, nightly builders (names must be different)
     # for easy access
@@ -553,19 +554,21 @@ def generateBranchObjects(config, name):
             triggeredUnittestBuilders.append(('%s-%s-unittest' % (name, platform), test_builders, config.get('enable_merging', True)))
         # Optimized unittest builds
         if pf.get('enable_opt_unittests'):
             test_builders = []
             for suites_name, suites in config['unittest_suites']:
                 test_builders.extend(generateTestBuilderNames('%s opt test' % base_name, suites_name, suites))
             triggeredUnittestBuilders.append(('%s-%s-opt-unittest' % (name, platform), test_builders, config.get('enable_merging', True)))
         if config['enable_codecoverage'] and platform in ('linux',):
-            weeklyBuilders.append('%s code coverage' % base_name)
+            coverageBuilders.append('%s code coverage' % base_name)
         if config['enable_xulrunner'] and platform not in ('wince',):
             xulrunnerNightlyBuilders.append('%s xulrunner' % base_name)
+    if config['enable_weekly_bundle']:
+        weeklyBuilders.append('%s hg bundle' % name)
 
     logUploadCmd = makeLogUploadCommand(name, config, is_try=config.get('enable_try'),
             is_shadow=bool(name=='shadow-central'))
 
     branchObjects['status'].append(SubprocessLogHandler(
         logUploadCmd,
         builders=builders + unittestBuilders + debugBuilders,
     ))
@@ -602,23 +605,23 @@ def generateBranchObjects(config, name):
         fromaddr="mozilla2.buildbot@build.mozilla.org",
         tree=config['tinderbox_tree'],
         extraRecipients=["tinderbox-daemon@tinderbox.mozilla.org"],
         relayhost="mail.build.mozilla.org",
         builders=unittestBuilders + debugBuilders,
         logCompression="gzip",
         errorparser="unittest"
     ))
-    # Weekly builds (currently only code coverage) go to a different tree
+    # Code coverage builds go to a different tree
     branchObjects['status'].append(TinderboxMailNotifier(
         fromaddr="mozilla2.buildbot@build.mozilla.org",
         tree=config['weekly_tinderbox_tree'],
         extraRecipients=["tinderbox-daemon@tinderbox.mozilla.org"],
         relayhost="mail.build.mozilla.org",
-        builders=weeklyBuilders,
+        builders=coverageBuilders,
         logCompression="gzip",
         errorparser="unittest"
     ))
 
     # Try Server notifier
     if config.get('enable_mail_notifier'):
         packageUrl = config['package_url']
         packageDir = config['package_dir']
@@ -1289,16 +1292,47 @@ def generateBranchObjects(config, name):
                  'builddir': '%s-%s-xulrunner' % (name, platform),
                  'factory': mozilla2_xulrunner_factory,
                  'category': name,
                  'nextSlave': _nextSlowSlave,
                  'properties': {'branch': name, 'platform': platform},
              }
              branchObjects['builders'].append(mozilla2_xulrunner_builder)
 
+        # -- end of per-platform loop --
+
+    if config['enable_weekly_bundle']:
+        bundle_factory = ScriptFactory(
+            config['hgurl'] + config['build_tools_repo_path'],
+            'scripts/bundle/hg-bundle.sh',
+            interpreter='bash',
+            script_timeout=3600,
+            script_maxtime=3600,
+            extra_args=[
+                name,
+                config['repo_path'],
+                config['stage_server'],
+                config['stage_username'],
+                config['stage_base_path'],
+                config['stage_ssh_key'],
+                ],
+        )
+        slaves = set()
+        for p in sorted(config['platforms'].keys()):
+            slaves.update(set(config['platforms'][p]['slaves']))
+        bundle_builder = {
+            'name': '%s hg bundle' % name,
+            'slavenames': list(slaves),
+            'builddir': '%s-bundle' % (name,),
+            'factory': bundle_factory,
+            'category': name,
+            'nextSlave': _nextSlowSlave,
+        }
+        branchObjects['builders'].append(bundle_builder)
+
     #Call out for mobile objects
     mobile_objects = generateMobileBranchObjects(config, name)
     for key in mobile_objects.keys():
         branchObjects[key].extend(mobile_objects[key])
     return branchObjects
 
 def generateCCBranchObjects(config, name):
     """name is the name of branch which is usually the last part of the path
@@ -1525,25 +1559,25 @@ def generateCCBranchObjects(config, name
                                    platform=platform,
                                    tree=tree,
                                    builderNames=[l10n_builder],
                                    branch=config['repo_path'],
                                    baseTag='default',
                                    localesFile=config['allLocalesFile']
                                   ))
 
-    for builder in weeklyBuilders:
-        weekly_scheduler=Nightly(
-            name=builder,
+    # schedule weekly builds - code coverage and generic weekly tasks
+    weekly_scheduler=Nightly(
+            name='weekly-%s' % name,
             branch=config['repo_path'],
             dayOfWeek=5, # Saturday
             hour=[3], minute=[02],
-            builderNames=[builder],
+            builderNames=coverageBuilders + weeklyBuilders,
         )
-        branchObjects['schedulers'].append(weekly_scheduler)
+    branchObjects['schedulers'].append(weekly_scheduler)
 
     for platform in sorted(config['platforms'].keys()):
         # shorthand
         pf = config['platforms'][platform]
 
         leakTest = False
         codesighs = config.get('enable_codesighs',True)
         uploadPackages = True