Bug 1356955 - Expose the taskcluster job name as an environment variable. r?dustin
--- a/taskcluster/taskgraph/transforms/task.py
+++ b/taskcluster/taskgraph/transforms/task.py
@@ -956,26 +956,28 @@ def build_task(config, tasks):
# 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.
+ # Also expose the job name as MOZ_JOB_NAME
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'
+ env['MOZ_JOB_NAME'] = task['label']
yield {
'label': task['label'],
'task': task_def,
'dependencies': task.get('dependencies', {}),
'attributes': attributes,
'optimizations': task.get('optimizations', []),
}