Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-12879

Verion 1.27 does not work with Tool Environment plugin

    XMLWordPrintable

Details

    Description

      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

      Attachments

        Activity

          f_zschocke Florian Zschocke created issue -
          gbois Gregory Boissinot made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          gbois Gregory Boissinot made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          f_zschocke Florian Zschocke made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 143338 ] JNJira + In-Review [ 205698 ]

          People

            gbois Gregory Boissinot
            f_zschocke Florian Zschocke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: