-
Bug
-
Resolution: Unresolved
-
Major
-
None
If you load a properties file as a build step, that overrides one or more build parameters, the injected variables will show up in the "Injected Environment Variables View", but the subsequent build steps will be provided with whatever was specified in the build parameter at the start of the build.
Consider the following:
Step 1 (generate the params.properties file)
cd sast_product
./waf configure
waf params
Here is the resulting file's contents:
SIM_REV = 81b806d6c4165277ad456a3ffd7ee2c5e0a9ed73
SIM_REMOTE_REV = d82501d4a73c200974138016f3b2628d0bbf0366
SIM_UI_REV = 2a0aef21282b1277f75555e9c68e4ace8deed055
FSW_CONTAINER_REV = 1e8d2005a045ac51219a1fd8915c7bd0f4f8a177
SIM_COMMON_REV = 6315defaf0c7376f2889bda3473828e2fbf2f743
SIM_INTERFACE_REV = 88c48d1349fb90cddbcaa1a21e93eee20cb15687
AST_REV = 8f947e56c1a6693687e8097fb50bba1626989ea6
WILLY_WONKA = harris
All but the last one map to build parameters. The last one is NOT a build parameter. Just a fake variable I added for test purposes.
Step 2 (Inject Environment variables)
Properties File Path: sast_product/build/params.properties
Console output:
[EnvInject] - Injecting environment variables from a build step.
[EnvInject] - Injecting as environment variables the properties file path 'sast_product/build/params.properties'
[EnvInject] - Variables injected successfully.
Step 3 (Execute shell and print the variables)
echo $SIM_COMMON_REV
echo $SIM_INTERFACE_REV
echo $WILLY_WONKA
Console output:
[sast_product_linux64] $ bash -xe /tmp/hudson6024044080448978568.sh
+ echo default
default
+ echo default
default
+ echo harris
You can see what's set in the environment are the build parameters ("default" is the default parameter value for SIM_COMMON_REV and SIM_INTERFACE_REV) and not the injected variables from the previous step. The dummy variable I added to the properties file that doesn't attempt to shadow a build parameter prints out OK.
I'm attaching the config.xml, but I'm hoping this description will suffice.
- is related to
-
JENKINS-16219 Version 1.77 injects all *environment* variables into ANT command line (-D)
- Resolved
- relates to
-
JENKINS-21177 EnvInject Plugin - Does not override environment variables at job level
- Open
-
JENKINS-16380 Starting with >1.73 global environment variables overrule build specific parameter variables
- Resolved
-
JENKINS-47370 Unable to override global envs after update to 2.1.4
- Closed