-
Improvement
-
Resolution: Unresolved
-
Major
I want to be able to supply a file path using environment variables.
For example, I have a global environment variable called SCRIPTDIR.
For Properties File Path, use as:
$SCRIPTDIR\job1-properties
[JENKINS-18051] EnvInject - prepare environment to run - allow for environment variables in file path names
Workflow | Original: JNJira [ 149348 ] | New: JNJira + In-Review [ 177331 ] |
This works fine using Jenkins v1.520 and EnvInject v1.85.
Syntax is:
"${SCRIPTDIR}\job1-properties"
Be aware that:
1) If the file does not exist in the given path, EnvInject does not expand environment variables in the error message and will display something like "[EnvInject] - [ERROR] - The given properties file path '${SCRIPTDIR}\job1-properties' doesn't exist."
2) EnvInject seems to be sensible to casing of variable names. In your example, configuring the file path to "${scriptdir}\job1-properties" will result in an error (see 1)).