Pass all zuul arguments to the job's shell script
The idea is that Zuul passes a lot of useful information, such as the
project name, target branch etc., as ZUUL_* options within the JSON job
data. Let's pass all of these variables to the launched shell script.
This will make it possible to e.g. have a single script that can do the
"right thing" for different projects with distinct build steps, etc.
Change-Id: I6f57ed19e9eef1b987fe2493d409b3ee51af22b6
diff --git a/turbo_hipster/lib/models.py b/turbo_hipster/lib/models.py
index b5c6b8e..c96a075 100644
--- a/turbo_hipster/lib/models.py
+++ b/turbo_hipster/lib/models.py
@@ -210,9 +210,14 @@
'unique_id': self.job.unique
}
)
+
+ env_args = copy.deepcopy(os.environ)
+ env_args.update(self.job_arguments)
+
self.script_return_code = utils.execute_to_log(
cmd,
- self.shell_output_log
+ self.shell_output_log,
+ env=env_args
)
@common.task_step