Bug 1381577 - Part F; Make artifact path setting more generic for windows worker. r=dustin
authorJustin Wood <Callek@gmail.com>
Mon, 17 Jul 2017 15:40:57 -0400
changeset 418969 c0e4c46f2954ca655e21ca97c40dca7abc5352f6
parent 418968 9fb0158afc853e908610583e865fa7882f3da772
child 418970 22c130a4b9af4f01b1c08c9f185d9b04b8519201
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1381577
milestone56.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 1381577 - Part F; Make artifact path setting more generic for windows worker. r=dustin Land date changes to support windows nightlies onto central MozReview-Commit-ID: BwBvzr46d20
taskcluster/taskgraph/transforms/job/common.py
taskcluster/taskgraph/transforms/job/mozharness.py
--- a/taskcluster/taskgraph/transforms/job/common.py
+++ b/taskcluster/taskgraph/transforms/job/common.py
@@ -40,24 +40,34 @@ def docker_worker_add_tc_vcs_cache(confi
     taskdesc['worker'].setdefault('caches', []).append({
         'type': 'persistent',
         'name': 'level-{}-{}-tc-vcs'.format(
             config.params['level'], config.params['project']),
         'mount-point': "/home/worker/.tc-vcs",
     })
 
 
-def docker_worker_add_public_artifacts(config, job, taskdesc):
+def add_public_artifacts(config, job, taskdesc, path):
     taskdesc['worker'].setdefault('artifacts', []).append({
         'name': 'public/build',
-        'path': '/home/worker/artifacts/',
+        'path': path,
         'type': 'directory',
     })
 
 
+def docker_worker_add_public_artifacts(config, job, taskdesc):
+    """ Adds a public artifact directory to the task """
+    add_public_artifacts(config, job, taskdesc, path='/home/worker/artifacts/')
+
+
+def generic_worker_add_public_artifacts(config, job, taskdesc):
+    """ Adds a public artifact directory to the task """
+    add_public_artifacts(config, job, taskdesc, path=r'public/build')
+
+
 def docker_worker_add_gecko_vcs_env_vars(config, job, taskdesc):
     """Add the GECKO_BASE_* and GECKO_HEAD_* env vars to the worker."""
     env = taskdesc['worker'].setdefault('env', {})
     env.update({
         'GECKO_BASE_REPOSITORY': config.params['base_repository'],
         'GECKO_HEAD_REF': config.params['head_rev'],
         'GECKO_HEAD_REPOSITORY': config.params['head_repository'],
         'GECKO_HEAD_REV': config.params['head_rev'],
--- a/taskcluster/taskgraph/transforms/job/mozharness.py
+++ b/taskcluster/taskgraph/transforms/job/mozharness.py
@@ -17,16 +17,17 @@ from taskgraph.util.schema import Schema
 from voluptuous import Required, Optional, Any
 
 from taskgraph.transforms.job import run_job_using
 from taskgraph.transforms.job.common import (
     docker_worker_add_workspace_cache,
     docker_worker_add_gecko_vcs_env_vars,
     docker_worker_setup_secrets,
     docker_worker_add_public_artifacts,
+    generic_worker_add_public_artifacts,
     support_vcs_checkout,
 )
 
 COALESCE_KEY = 'builds.{project}.{name}'
 
 mozharness_run_schema = Schema({
     Required('using'): 'mozharness',
 
@@ -207,20 +208,17 @@ def mozharness_on_generic_worker(config,
     if not run.get('keep-artifacts', True):
         invalid.append('keep-artifacts')
     if invalid:
         raise Exception("Jobs run using mozharness on Windows do not support properties " +
                         ', '.join(invalid))
 
     worker = taskdesc['worker']
 
-    worker['artifacts'] = [{
-        'path': r'public/build',
-        'type': 'directory',
-    }]
+    generic_worker_add_public_artifacts(config, job, taskdesc)
 
     docker_worker_add_gecko_vcs_env_vars(config, job, taskdesc)
 
     env = worker['env']
     env.update({
         'MOZ_BUILD_DATE': config.params['moz_build_date'],
         'MOZ_SCM_LEVEL': config.params['level'],
         'MOZ_AUTOMATION': '1',