Bug 1426776 - Don't setup dotcache cache when not requested. r?dustin draft
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 22 Dec 2017 08:35:20 +0900
changeset 714253 4037eaed5e6694572ffdcc9239afa8409f3deb3b
parent 713998 5b1fdaa14d35ddf1a638c9422786ede707cacf1f
child 744551 9365b93343bad47c0c8ef83e35c010799382230c
push id93880
push userbmo:mh+mozilla@glandium.org
push dateThu, 21 Dec 2017 23:36:44 +0000
reviewersdustin
bugs1426776
milestone59.0a1
Bug 1426776 - Don't setup dotcache cache when not requested. r?dustin
taskcluster/taskgraph/transforms/job/run_task.py
--- a/taskcluster/taskgraph/transforms/job/run_task.py
+++ b/taskcluster/taskgraph/transforms/job/run_task.py
@@ -58,22 +58,23 @@ def add_checkout_to_command(run, command
 
 
 @run_job_using("docker-worker", "run-task", schema=run_task_schema)
 def docker_worker_run_task(config, job, taskdesc):
     run = job['run']
     worker = taskdesc['worker'] = job['worker']
     common_setup(config, job, taskdesc)
 
-    worker['caches'].append({
-        'type': 'persistent',
-        'name': 'level-{level}-{project}-dotcache'.format(**config.params),
-        'mount-point': '/builds/worker/.cache',
-        'skip-untrusted': True,
-    })
+    if run.get('cache-dotcache'):
+        worker['caches'].append({
+            'type': 'persistent',
+            'name': 'level-{level}-{project}-dotcache'.format(**config.params),
+            'mount-point': '/builds/worker/.cache',
+            'skip-untrusted': True,
+        })
 
     run_command = run['command']
     if isinstance(run_command, basestring):
         run_command = ['bash', '-cx', run_command]
     command = ['/builds/worker/bin/run-task']
     add_checkout_to_command(run, command)
     if run['comm-checkout']:
         command.append('--comm-checkout=/builds/worker/checkouts/gecko/comm')