Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins: How to set environment variables for ant task by "source script"

Imagine a classic set_env.sh shell script which exports some environment variables which contents are calculated (non-static, depending on the file system).

In Jenkins, I'd like to execute this shell script and afterwards calling an ant build step using the previous environment from the script.

Is there a way to do that in jenkins?

like image 631
MRalwasser Avatar asked Dec 07 '25 05:12

MRalwasser


1 Answers

Another way would be to use the Envinject plugin. This lets you "inject" environment variables from a file so that they become part of the build environment, usable by all build steps.

like image 178
EricP Avatar answered Dec 08 '25 19:12

EricP