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

Jenkins/EnvInject incorrectly sets ${WORKSPACE} on slave node

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: envinject-plugin
    • Labels:
      None
    • Environment:
      Linux 2.6.40-3.0.9 #9 SMP Tue Sep 11 09:59:55 PDT 2012 x86_64 x86_64 x86_64 GNU/Linux
      EnvInjectPlugin 1.88
    • Similar Issues:

      Description

      When a jobs is launched on a slave, ${WORKSPACE} is set to the slave root instead of the workspace directory when EnvInject is enabled (default settings in this case). I setup a simple example with a project that does

      echo ${WORKSPACE}
      pwd

      The project is a basic project (named Test-Slave) - the only selection changed from the default is "Restrict where this project can be run" which I set to my slave. Here is the console for the job. You can see the difference between ${WORKSPACE} and pwd.

      [EnvInject] - Loading node environment variables.
      Building remotely on XL-build1 in workspace /home/scratch/jenkins_xl/workspace/Test-Slave
      [Test-Slave] $ /bin/sh -xe /tmp/hudson4075547965590808000.sh
      + echo /home/scratch/jenkins_xl
      /home/scratch/jenkins_xl
      + pwd
      /home/scratch/jenkins_xl/workspace/Test-Slave

        Attachments

          Activity

          ajbarber Andrew Barber created issue -
          ajbarber Andrew Barber made changes -
          Field Original Value New Value
          Component/s envinject [ 15893 ]
          Component/s slave-setup [ 15929 ]
          Assignee Kohsuke Kawaguchi [ kohsuke ] Gregory Boissinot [ gbois ]
          Description When a jobs is launched on a slave, ${WORKSPACE} is set to the slave root instead of the workspace directory. I setup a simple example with a project that does

          echo ${WORKSPACE}
          pwd

          The project is a basic project - the only selection changed from the default is "Restrict where this project can be run" which I set to my slave. Here is the console for the job. You can see the difference between ${WORKSPACE} and pwd.

          [EnvInject] - Loading node environment variables.
          Building remotely on XL-build1 in workspace /home/scratch/jenkins_xl/workspace/Test-Slave
          [Test-Slave] $ /bin/sh -xe /tmp/hudson4075547965590808000.sh
          + echo /home/scratch/jenkins_xl
          /home/scratch/jenkins_xl
          + pwd
          /home/scratch/jenkins_xl/workspace/Test-Slave
          When a jobs is launched on a slave, ${WORKSPACE} is set to the slave root instead of the workspace directory when EnvInject is enabled (default settings in this case). I setup a simple example with a project that does

          echo ${WORKSPACE}
          pwd

          The project is a basic project (named Test-Slave) - the only selection changed from the default is "Restrict where this project can be run" which I set to my slave. Here is the console for the job. You can see the difference between ${WORKSPACE} and pwd.

          [EnvInject] - Loading node environment variables.
          Building remotely on XL-build1 in workspace /home/scratch/jenkins_xl/workspace/Test-Slave
          [Test-Slave] $ /bin/sh -xe /tmp/hudson4075547965590808000.sh
          + echo /home/scratch/jenkins_xl
          /home/scratch/jenkins_xl
          + pwd
          /home/scratch/jenkins_xl/workspace/Test-Slave
          Priority Major [ 3 ] Critical [ 2 ]
          ajbarber Andrew Barber made changes -
          Summary Jenkins incorrectly sets ${WORKSPACE} on slave node Jenkins/EnvInject incorrectly sets ${WORKSPACE} on slave node
          ajbarber Andrew Barber made changes -
          Environment Linux 2.6.40-3.0.9 #9 SMP Tue Sep 11 09:59:55 PDT 2012 x86_64 x86_64 x86_64 GNU/Linux Linux 2.6.40-3.0.9 #9 SMP Tue Sep 11 09:59:55 PDT 2012 x86_64 x86_64 x86_64 GNU/Linux
          EnvInjectPlugin 1.88
          ajbarber Andrew Barber made changes -
          Priority Critical [ 2 ] Major [ 3 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 151273 ] JNJira + In-Review [ 177900 ]

            People

            Assignee:
            gbois Gregory Boissinot
            Reporter:
            ajbarber Andrew Barber
            Votes:
            5 Vote for this issue
            Watchers:
            8 Start watching this issue

              Dates

              Created:
              Updated: