-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
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
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
[JENKINS-19754] Jenkins/EnvInject incorrectly sets ${WORKSPACE} on slave node
Component/s | New: envinject [ 15893 ] | |
Component/s | Original: slave-setup [ 15929 ] | |
Assignee | Original: Kohsuke Kawaguchi [ kohsuke ] | New: Gregory Boissinot [ gbois ] |
Description |
Original:
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 |
New:
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 | Original: Major [ 3 ] | New: Critical [ 2 ] |
Summary | Original: Jenkins incorrectly sets ${WORKSPACE} on slave node | New: Jenkins/EnvInject incorrectly sets ${WORKSPACE} on slave node |
Environment | Original: 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 |
New:
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 |
Priority | Original: Critical [ 2 ] | New: Major [ 3 ] |
Upgraded to jenkins 1.534, still same issue. I have a workaround now though.
○ Select "Prepare jobs environment" on the slave
○ Select "Unset System Environment Variables" on the slave
Both of these must be set and the ${WORKSPACE} appears correctly. I would think that unsetting system variables would lead to ${WORKSPACE} issues instead of fixing it.
Either way, I think ${WORKSPACE} should be correct regardless of these settings.