Bug 1118797 - schedule source jobs for release promotion, r=bhearsum
authorNick Thomas <nthomas@mozilla.com>
Tue, 31 Mar 2015 12:00:37 +1300
changeset 4167 adf6052198a4c248c8a7b05bf4e64a57df8ee48d
parent 4163 6c2b489f2866731afc7f45f7d91cf29acc33da74
child 4168 b537e78b3f084e732a024e266d8c3399c1f1385e
child 4170 a4247fb4c8343fe3560aed6200766255a3b6d36d
push id3471
push usernthomas@mozilla.com
push dateMon, 30 Mar 2015 23:01:19 +0000
reviewersbhearsum
bugs1118797
Bug 1118797 - schedule source jobs for release promotion, r=bhearsum
misc.py
--- a/misc.py
+++ b/misc.py
@@ -2329,16 +2329,20 @@ def generateBranchObjects(config, name, 
                 'category': name,
                 'nextSlave': _nextAWSSlave_sort,
                 'properties': {'branch': name, 'platform': platform, 'slavebuilddir': normalizeName('%s-%s-xulrunner-nightly' % (name, platform)), 'product': 'xulrunner'},
             }
             branchObjects['builders'].append(mozilla2_xulrunner_builder)
 
         # -- end of per-platform loop --
 
+    if config.get('enable_release_promotion'):
+        promotionObjects = generateReleasePromotionObjects(config, name, secrets)
+        branchObjects = mergeBuildObjects(branchObjects, promotionObjects)
+
     return branchObjects
 
 
 def generateTalosBranchObjects(branch, branch_config, PLATFORMS, SUITES,
                                ACTIVE_UNITTEST_PLATFORMS):
     branchObjects = {'schedulers': [], 'builders': [], 'status': [],
                      'change_source': []}
     # prettyNames is a mapping to pass to the try_parser for validation
@@ -3382,8 +3386,65 @@ def mh_l10n_builder_names(config, platfo
         name = '%s nightly' % (name)
     repacks = pf['mozharness_desktop_l10n']
 
     l10n_chunks = repacks['l10n_chunks']
     for chunk in range(1, l10n_chunks + 1):
         builder_name = "%s l10n %s/%s" % (name, chunk, l10n_chunks)
         names.append(builder_name)
     return names
+
+
+def generateReleasePromotionObjects(config, name, secrets):
+    builders = []
+    schedulers = []
+    change_sources = []
+    status = []
+    buildObjects = {
+        'builders': builders,
+        'schedulers': schedulers,
+        'status': status,
+        'change_source': change_sources,
+    }
+
+    topLevelBuilders = []
+    pf_linux64 = config['platforms']['linux64']
+    signing_servers = secrets.get(pf_linux64.get('dep_signing_servers'))
+
+    # source builder
+    source_buildername = '%s_source' % name
+    source_factory = makeMHFactory(config, pf_linux64,
+            mh_cfg=pf_linux64['mozharness_desktop_build'],
+            extra_args=pf_linux64['mozharness_desktop_build'].get('extra_args', []) + \
+                       ['--custom-build-variant-cfg', 'source'],
+            signingServers=signing_servers)
+
+    source_builder = {
+        'name': source_buildername,
+        'factory': source_factory,
+        'builddir': source_buildername,
+        'slavenames': pf_linux64['slaves'],
+        'category': name,
+        'properties': {
+            'branch': name,
+            'platform': 'source',
+            'product': pf_linux64['stage_product'],
+            'repo_path': config['repo_path'],
+            'script_repo_revision': config["mozharness_tag"],
+        },
+    }
+    topLevelBuilders.append(source_buildername)
+    builders.append(source_builder)
+
+    # To add short-term: partner-repack
+    # Longer-term: l10n repacks, funsize partials, antivirus, checksums etc
+
+    # sendchange listener
+    starting_scheduler = Scheduler(
+        name='%s_start_promotion' % name,
+        branch='%s-build-promotion' % name,
+        treeStableTimer=None,
+        builderNames=topLevelBuilders,
+    )
+    schedulers.append(starting_scheduler)
+
+    return buildObjects
+