Bug 1356700 - Set MOZ_AUTOMATION on all taskcluster jobs. r?dustin
--- a/taskcluster/taskgraph/transforms/task.py
+++ b/taskcluster/taskgraph/transforms/task.py
@@ -950,16 +950,28 @@ def build_task(config, tasks):
th_push_link)
# add the payload and adjust anything else as required (e.g., scopes)
payload_builders[task['worker']['implementation']](config, task, task_def)
attributes = task.get('attributes', {})
attributes['run_on_projects'] = task.get('run-on-projects', ['all'])
+ # Set MOZ_AUTOMATION on all jobs.
+ if task['worker']['implementation'] in (
+ 'generic-worker',
+ 'docker-engine',
+ 'native-engine',
+ 'docker-worker',
+ ):
+ payload = task_def.get('payload')
+ if payload:
+ env = payload.setdefault('env', {})
+ env['MOZ_AUTOMATION'] = '1'
+
yield {
'label': task['label'],
'task': task_def,
'dependencies': task.get('dependencies', {}),
'attributes': attributes,
'optimizations': task.get('optimizations', []),
}