bug 1442793 - signed_artifacts artifact_prefix. r=bhearsum
authorAki Sasaki <asasaki@mozilla.com>
Wed, 07 Mar 2018 14:14:52 -0800
changeset 413958 298f38a58ec78363f7e09049dc4ca50e24f003af
parent 413957 25ea434bd55e0c01a84c3cf7cc3a69765ec5e37b
child 413959 1a93b230ff0d06b96552010a1ff229d33676ad9e
push id33853
push usercbrindusan@mozilla.com
push dateTue, 17 Apr 2018 09:51:13 +0000
treeherdermozilla-central@8b0ba3f7d099 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhearsum
bugs1442793
milestone61.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 1442793 - signed_artifacts artifact_prefix. r=bhearsum MozReview-Commit-ID: FYmqn67shHF
taskcluster/taskgraph/transforms/build_signing.py
taskcluster/taskgraph/transforms/nightly_l10n_signing.py
taskcluster/taskgraph/util/signed_artifacts.py
--- a/taskcluster/taskgraph/transforms/build_signing.py
+++ b/taskcluster/taskgraph/transforms/build_signing.py
@@ -4,16 +4,17 @@
 """
 Transform the signing task into an actual task description.
 """
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 from taskgraph.transforms.base import TransformSequence
 from taskgraph.util.signed_artifacts import generate_specifications_of_artifacts_to_sign
+from taskgraph.util.taskcluster import get_artifact_path
 
 
 transforms = TransformSequence()
 
 
 @transforms.add
 def add_signed_routes(config, jobs):
     """Add routes corresponding to the routes of the build task
@@ -37,25 +38,26 @@ def add_signed_routes(config, jobs):
 
 @transforms.add
 def define_upstream_artifacts(config, jobs):
     for job in jobs:
         dep_job = job['dependent-task']
         build_platform = dep_job.attributes.get('build_platform')
 
         artifacts_specifications = generate_specifications_of_artifacts_to_sign(
-            build_platform,
-            dep_job.attributes.get('nightly'),
+            dep_job,
             keep_locale_template=False,
             kind=config.kind,
         )
 
         if 'android' in build_platform:
             # We're in the job that creates both multilocale and en-US APKs
-            artifacts_specifications[0]['artifacts'].append('public/build/en-US/target.apk')
+            artifacts_specifications[0]['artifacts'].append(
+                get_artifact_path(dep_job, 'en-US/target.apk')
+            )
 
         job['upstream-artifacts'] = [{
             'taskId': {'task-reference': '<build>'},
             'taskType': 'build',
             'paths': spec['artifacts'],
             'formats': spec['formats'],
         } for spec in artifacts_specifications]
 
--- a/taskcluster/taskgraph/transforms/nightly_l10n_signing.py
+++ b/taskcluster/taskgraph/transforms/nightly_l10n_signing.py
@@ -33,18 +33,17 @@ def make_signing_description(config, job
 
 
 @transforms.add
 def define_upstream_artifacts(config, jobs):
     for job in jobs:
         dep_job = job['dependent-task']
 
         locale_specifications = generate_specifications_of_artifacts_to_sign(
-            dep_job.attributes.get('build_platform'),
-            is_nightly=True,
+            dep_job,
             keep_locale_template=True
         )
 
         upstream_artifacts = []
         for spec in locale_specifications:
             upstream_artifacts.append({
                 'taskId': {'task-reference': '<unsigned-repack>'},
                 'taskType': 'l10n',
--- a/taskcluster/taskgraph/util/signed_artifacts.py
+++ b/taskcluster/taskgraph/util/signed_artifacts.py
@@ -1,59 +1,64 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 """
 Defines artifacts to sign before repackage.
 """
 
 from __future__ import absolute_import, print_function, unicode_literals
+from taskgraph.util.taskcluster import get_artifact_path
 
 
 def generate_specifications_of_artifacts_to_sign(
-    build_platform, is_nightly=False, keep_locale_template=True, kind=None
+    task, keep_locale_template=True, kind=None
 ):
+    build_platform = task.attributes.get('build_platform')
+    is_nightly = task.attributes.get('nightly')
     if kind == 'release-source-signing':
         artifacts_specifications = [{
             'artifacts': [
-                'public/build/source.tar.xz'
+                get_artifact_path(task, 'source.tar.xz')
             ],
             'formats': ['gpg'],
         }]
     elif 'android' in build_platform:
         artifacts_specifications = [{
             'artifacts': [
-                'public/build/{locale}/target.apk',
+                get_artifact_path(task, '{locale}/target.apk'),
             ],
             'formats': ['jar'],
         }]
     # XXX: Mars aren't signed here (on any platform) because internals will be
     # signed at after this stage of the release
     elif 'macosx' in build_platform:
         artifacts_specifications = [{
-            'artifacts': ['public/build/{locale}/target.dmg'],
+            'artifacts': [get_artifact_path(task, '{locale}/target.dmg')],
             'formats': ['macapp', 'widevine'],
         }]
     elif 'win' in build_platform:
         artifacts_specifications = [{
             'artifacts': [
-                'public/build/{locale}/setup.exe',
+                get_artifact_path(task, '{locale}/setup.exe'),
             ],
             'formats': ['sha2signcode'],
         }, {
             'artifacts': [
-                'public/build/{locale}/target.zip',
+                get_artifact_path(task, '{locale}/target.zip'),
             ],
             'formats': ['sha2signcode', 'widevine'],
         }]
         if 'win32' in build_platform and is_nightly:
-            artifacts_specifications[0]['artifacts'] += ['public/build/{locale}/setup-stub.exe']
+            artifacts_specifications[0]['artifacts'] += [
+                get_artifact_path(task, '{locale}/setup-stub.exe')
+            ]
     elif 'linux' in build_platform:
         artifacts_specifications = [{
-            'artifacts': ['public/build/{locale}/target.tar.bz2'],
+            'artifacts': [get_artifact_path(task, '{locale}/target.tar.bz2')],
             'formats': ['gpg', 'widevine'],
         }]
     else:
         raise Exception("Platform not implemented for signing")
 
     if not keep_locale_template:
         artifacts_specifications = _strip_locale_template(artifacts_specifications)