bug 1442793 - repackage artifact_prefix. r=bhearsum
authorAki Sasaki <asasaki@mozilla.com>
Wed, 21 Mar 2018 12:32:57 -0700
changeset 413964 d552d6d9ac7f4b989541f723c5211336a0a90ce4
parent 413963 58b09a0406d5581ee0e179cdf5f0164ac47b5469
child 413965 dac61b3288af2f3146a209e52d67b63383c8e972
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 - repackage artifact_prefix. r=bhearsum MozReview-Commit-ID: KTKKJQJJEAy
taskcluster/taskgraph/transforms/repackage.py
--- a/taskcluster/taskgraph/transforms/repackage.py
+++ b/taskcluster/taskgraph/transforms/repackage.py
@@ -12,17 +12,17 @@ import copy
 from taskgraph.transforms.base import TransformSequence
 from taskgraph.util.attributes import copy_attributes_from_dependent_job
 from taskgraph.util.schema import (
     validate_schema,
     optionally_keyed_by,
     resolve_keyed_by,
     Schema,
 )
-from taskgraph.util.taskcluster import get_taskcluster_artifact_prefix
+from taskgraph.util.taskcluster import get_taskcluster_artifact_prefix, get_artifact_prefix
 from taskgraph.transforms.task import task_description_schema
 from voluptuous import Any, Required, Optional
 
 transforms = TransformSequence()
 
 # Voluptuous uses marker objects as dictionary *keys*, but they are not
 # comparable, so we cast all of the keys back to regular strings
 task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
@@ -181,17 +181,17 @@ def make_job_description(config, jobs):
             'job-script': 'taskcluster/scripts/builder/repackage.sh',
             'actions': ['download_input', 'setup', 'repackage'],
             'extra-workspace-cache-key': 'repackage',
         })
 
         worker = {
             'env': _generate_task_env(dep_job, build_platform, build_task_ref,
                                       signing_task_ref, locale=locale),
-            'artifacts': _generate_task_output_files(build_platform, locale=locale),
+            'artifacts': _generate_task_output_files(dep_job, build_platform, locale=locale),
             'chain-of-trust': True,
             'max-run-time': 7200 if build_platform.startswith('win') else 3600,
         }
 
         if locale:
             # Make sure we specify the locale-specific upload dir
             worker['env'].update(LOCALE=locale)
 
@@ -268,50 +268,55 @@ def _generate_task_env(task, build_platf
             task_env['SIGNED_SETUP_STUB'] = {
                 'task-reference': '{}setup-stub.exe'.format(signed_prefix),
             }
         return task_env
 
     raise NotImplementedError('Unsupported build_platform: "{}"'.format(build_platform))
 
 
-def _generate_task_output_files(build_platform, locale=None):
+def _generate_task_output_files(task, build_platform, locale=None):
     locale_output_path = '{}/'.format(locale) if locale else ''
+    artifact_prefix = get_artifact_prefix(task)
 
     if build_platform.startswith('linux') or build_platform.startswith('macosx'):
         output_files = [{
             'type': 'file',
             'path': '/builds/worker/workspace/build/artifacts/{}target.complete.mar'
                     .format(locale_output_path),
-            'name': 'public/build/{}target.complete.mar'.format(locale_output_path),
+            'name': '{}/{}target.complete.mar'.format(artifact_prefix, locale_output_path),
         }]
 
         if build_platform.startswith('macosx'):
             output_files.append({
                 'type': 'file',
                 'path': '/builds/worker/workspace/build/artifacts/{}target.dmg'
                         .format(locale_output_path),
-                'name': 'public/build/{}target.dmg'.format(locale_output_path),
+                'name': '{}/{}target.dmg'.format(artifact_prefix, locale_output_path),
             })
 
     elif build_platform.startswith('win'):
         output_files = [{
             'type': 'file',
-            'path': 'public/build/{}target.installer.exe'.format(locale_output_path),
-            'name': 'public/build/{}target.installer.exe'.format(locale_output_path),
+            'path': '{}/{}target.installer.exe'.format(artifact_prefix, locale_output_path),
+            'name': '{}/{}target.installer.exe'.format(artifact_prefix, locale_output_path),
         }, {
             'type': 'file',
-            'path': 'public/build/{}target.complete.mar'.format(locale_output_path),
-            'name': 'public/build/{}target.complete.mar'.format(locale_output_path),
+            'path': '{}/{}target.complete.mar'.format(artifact_prefix, locale_output_path),
+            'name': '{}/{}target.complete.mar'.format(artifact_prefix, locale_output_path),
         }]
 
         # Stub installer is only generated on win32
         if '32' in build_platform:
             output_files.append({
                 'type': 'file',
-                'path': 'public/build/{}target.stub-installer.exe'.format(locale_output_path),
-                'name': 'public/build/{}target.stub-installer.exe'.format(locale_output_path),
+                'path': '{}/{}target.stub-installer.exe'.format(
+                    artifact_prefix, locale_output_path
+                ),
+                'name': '{}/{}target.stub-installer.exe'.format(
+                    artifact_prefix, locale_output_path
+                ),
             })
 
     if output_files:
         return output_files
 
     raise NotImplementedError('Unsupported build_platform: "{}"'.format(build_platform))