[ 
https://issues.jenkins-ci.org/browse/JENKINS-12879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=159509#comment-159509
 ] 

Florian Zschocke commented on JENKINS-12879:
--------------------------------------------

Thanks for the tip. I have tried to use the Shared Object plugin instead. The 
problem remains because while the SO plugin does set the tool names as 
environment variables which can be used in the job, they can not be used, i.e. 
referenced, when injecting environment variables with EnvInject.

I have a tool naem "Maven 2.2.1" which creates a env variable of the same name.
When I set the environment with EnvInject, I have something like:

MAVEN_BIN=${Maven 2.2.1}/bin

This does not work, the variable "Maven 2.2.1" can not be resolved by 
EnvInject. Changing the tool name to contain an underscore instead of space did 
not help. Are the tool environment variables created by the SO plugin supposed 
to be referencable in EnvInject configuration?


So far I have to return to SetEnv/ToolEnvironment because EnvInject cannot 
replace the functionality that combi provides. What I am trying to do is get 
tool paths in the PATH for jobs we run (i.e. an Ant job).

Thanks for looking into it.
                
> Verion 1.27 does not work with Tool Environment plugin
> ------------------------------------------------------
>
>                 Key: JENKINS-12879
>                 URL: https://issues.jenkins-ci.org/browse/JENKINS-12879
>             Project: Jenkins
>          Issue Type: Bug
>          Components: envinject
>    Affects Versions: current
>            Reporter: Florian Zschocke
>            Assignee: gbois
>              Labels: plugin
>
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to