-
Bug
-
Resolution: Fixed
-
Major
We use the Tool Environment Plugin to set environment variables with path for tools. We used the SetEnv plugin before together with the TE plugin and the tool environment variables could be used in the SetEnv configuration. This does not work with the EnvInject plugin, which is supposed to replace the SetEnv plugin.
Configuration:
We have tool environment variables
MAVEN_2_2_1_HOME
JAVA_IBM_60_81_HOME
ANT_1_6_5_HOME
The SetEnv plugin set the environment for a build using these:
PROJECT_TOP=${WORKSPACE}
PROJECT_BUILD=$PROJECT_TOP/build
PROJECT_RES=$PROJECT_TOP/delivery
PROJECT_SRC=$PROJECT_TOP
JAVA_HOME=${JAVA_IBM_60_81_HOME}
PATH=${JAVA_HOME}/bin:${MAVEN_2_2_1_HOME}/bin:${ANT_1_6_5_HOME}/bin:$PATH
This would work.
Using the EnvInject plugin on a new Jenksin 1.451 installation, I was so far not able to find any configuration which would work. The EnvInject plugin does not see the tool environment variables, or the PATH variable. This are the results:
[EnvInject] - Injecting environment variables from a build step.
[EnvInject] - Injecting as environment variables the properties content
BRANCH=trunk
PROJECT_TOP=${WORKSPACE}
PROJECT_BUILD=$PROJECT_TOP/build
PROJECT_RES=$PROJECT_TOP/delivery
PROJECT_SRC=$PROJECT_TOP
JAVA_HOME=${JAVA_IBM_60_81_HOME}
PATH=${JAVA_HOME}/bin:${MAVEN_2_2_1_HOME}/bin:${ANT_1_6_5_HOME}/bin:$PATH
[EnvInject] - Variables injected successfully.
[EnvInject] - Unset unresolved 'JAVA_HOME' variable.
[EnvInject] - Unset unresolved 'PATH' variable.
Setting ANT_1_6_5_HOME=/data/sourcecode/cbe-tools/ant/1.6.5
Setting MAVEN_2_2_1_HOME=/data/sourcecode/cbe-tools/maven/2.2.1
Setting JAVA_IBM_60_81_HOME=/data/build-env/java/ibm-java2-i386-6.0.8.1
or:
[EnvInject] - Executing scripts and injecting environment variables after the SCM step.
[EnvInject] - Executing and processing the following script content:
BRANCH=trunk
PROJECT_TOP=${WORKSPACE}
PROJECT_BUILD=$PROJECT_TOP/build
PROJECT_RES=$PROJECT_TOP/delivery
PROJECT_SRC=$PROJECT_TOP
JAVA_HOME=${JAVA_IBM_60_81_HOME}
PATH=${JAVA_HOME}/bin:${MAVEN_2_2_1_HOME}/bin:${ANT_1_6_5_HOME}/bin:$PATH
[hourly] $ /bin/sh -xe /tmp/hudson6496656756456228415.sh
+ BRANCH=trunk
+ PROJECT_TOP=/data/sourcecode/domain/trunk/hourly
+ PROJECT_BUILD=/data/sourcecode/domain/trunk/hourly/build
+ PROJECT_RES=/data/sourcecode/domain/trunk/hourly/delivery
+ PROJECT_SRC=/data/sourcecode/domain/trunk/hourly
+ JAVA_HOME=
+ PATH=/bin:/bin:/bin:/data/build-env/java/ibm-java2-i386-6.0.8.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/usr/lib/mit/sbin
[EnvInject] - Script executed successfully.
Setting ANT_1_6_5_HOME=/data/sourcecode/cbe-tools/ant/1.6.5
Setting MAVEN_2_2_1_HOME=/data/sourcecode/cbe-tools/maven/2.2.1
Setting JAVA_IBM_60_81_HOME=/data/build-env/java/ibm-java2-i386-6.0.8.1
This came closest, but the PATH variable cannot be seen:
[EnvInject] - Injecting environment variables from a build step.
Setting ANT_1_6_5_HOME=/data/sourcecode/cbe-tools/ant/1.6.5
Setting MAVEN_2_2_1_HOME=/data/sourcecode/cbe-tools/maven/2.2.1
Setting JAVA_IBM_60_81_HOME=/data/build-env/java/ibm-java2-i386-6.0.8.1
[EnvInject] - Injecting as environment variables the properties content
BRANCH=trunk
PROJECT_TOP=${WORKSPACE}
PROJECT_BUILD=$PROJECT_TOP/build
PROJECT_RES=$PROJECT_TOP/delivery
PROJECT_SRC=$PROJECT_TOP
JAVA_HOME=${JAVA_IBM_60_81_HOME}
PATH=${JAVA_HOME}/bin:${MAVEN_2_2_1_HOME}/bin:${ANT_1_6_5_HOME}/bin:$PATH
[EnvInject] - Variables injected successfully.
[EnvInject] - Unset unresolved 'PATH' variable.
Setting ANT_1_6_5_HOME=/data/sourcecode/cbe-tools/ant/1.6.5
Setting MAVEN_2_2_1_HOME=/data/sourcecode/cbe-tools/maven/2.2.1
Setting JAVA_IBM_60_81_HOME=/data/build-env/java/ibm-java2-i386-6.0.8.1