bug 1425095: add in-tree balrog publishing tasks. r=bhearsum
authorJohan Lorenzo <jlorenzo@mozilla.com>
Mon, 18 Dec 2017 10:54:58 -0500
changeset 396725 cb24cbab90a746fdcaa6a09750d00b850fd66915
parent 396724 767cb7462ef858b377678af010d2111fa35deacb
child 396726 ed829e5548ca92a05de56f2069427ad10061d956
push id33110
push userrgurzau@mozilla.com
push dateMon, 18 Dec 2017 21:58:12 +0000
treeherdermozilla-central@7c4579e705c4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhearsum
bugs1425095
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1425095: add in-tree balrog publishing tasks. r=bhearsum
taskcluster/taskgraph/transforms/job/buildbot.py
--- a/taskcluster/taskgraph/transforms/job/buildbot.py
+++ b/taskcluster/taskgraph/transforms/job/buildbot.py
@@ -27,26 +27,56 @@ buildbot_run_schema = Schema({
 
     # the product to use
     Required('product'): Any('firefox', 'mobile', 'fennec', 'devedition', 'thunderbird'),
 
     Optional('release-promotion'): bool,
 })
 
 
+def _get_balrog_api_root(branch):
+    if branch in ('mozilla-beta', 'mozilla-release') or branch.startswith('mozilla-esr'):
+        return 'https://aus4-admin.mozilla.org/api'
+    else:
+        return 'https://balrog-admin.stage.mozaws.net/api'
+
+
+def _get_balrog_channel(product, branch):
+    if product == 'devedition':
+        return 'aurora'
+    elif product == 'firefox':
+        if branch in ('mozilla-beta', 'maple'):
+            return 'beta'
+        elif branch == 'mozilla-release':
+            return 'release'
+        elif branch.startswith('mozilla-esr'):
+            return 'esr'
+    # Unsupported channels are filtered out after the task is generated. Then, we must
+    # provide a dummy value for them, otherwise the Decision task breaks.
+    return 'unknown'
+
+
 def bb_release_worker(config, worker, run):
     # props
     release_props = get_release_config(config)
     repo_path = urlparse(config.params['head_repository']).path.lstrip('/')
     revision = config.params['head_rev']
+    branch = config.params['project']
+    product = run['product']
+
     release_props.update({
         'release_promotion': True,
         'repo_path': repo_path,
         'revision': revision,
     })
+
+    if product in ('devedition', 'firefox'):
+        release_props['balrog_api_root'] = _get_balrog_api_root(branch)
+        release_props['channels'] = _get_balrog_channel(product, branch)
+
     worker['properties'].update(release_props)
     # Setting script_repo_revision to the gecko revision doesn't work for
     # jobs that clone build/tools or other repos instead of gecko.
     if 'script_repo_revision' not in worker['properties']:
         worker['properties']['script_repo_revision'] = revision
 
 
 def bb_ci_worker(config, worker):