From 3e3deef7b81baf88cd1ebc744f5e7342ab97b72c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= Date: Fri, 28 Nov 2014 02:20:12 +0100 Subject: [PATCH] Export job name to the shell script, too self.job_name is something like "shell_script-${hostname}-${number}", and job_arguments doesn't contain anything like a job name, either. Change-Id: I775609990c740c29016abe89c5dce9ab81ca61b9 --- turbo_hipster/lib/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/turbo_hipster/lib/models.py b/turbo_hipster/lib/models.py index 08e0755..4da226b 100644 --- a/turbo_hipster/lib/models.py +++ b/turbo_hipster/lib/models.py @@ -228,6 +228,10 @@ class ShellTask(Task): env_args = copy.deepcopy(os.environ) env_args.update(self.job_arguments) + if self.job.name.startswith('build:'): + env_args['TH_JOB_NAME'] = self.job.name[len('build:'):] + else: + env_args['TH_JOB_NAME'] = self.job.name self.script_return_code = utils.execute_to_log( cmd,