Details
-
Bug
-
Status: Resolved (View Workflow)
-
Major
-
Resolution: Not A Defect
-
None
Description
When having a pipeline task running over multiple nodes in sequence, the PATH environment is not reset when running on the next node. Here is a sample
node('linux'){ env.PATH = "${env.PATH}:/opt/myapp" echo "${env.PATH}" } node('windows'){ env.PATH = "${env.PATH}:c:\\opt\\myapp" echo "${env.PATH}" }
Output:
[Pipeline] node Running on linux in /var/lib/jenkins/jobs/test-job/workspace [Pipeline] { [Pipeline] echo /sbin:/usr/sbin:/bin:/usr/bin:/opt/myapp [Pipeline] } [Pipeline] // node [Pipeline] node Running on windows in c:/jenkins-slave/workspace/test-job [Pipeline] { [Pipeline] echo /sbin:/usr/sbin:/bin:/usr/bin:/opt/myapp:c:\opt\myapp [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline Finished: SUCCESS
The PATH variable is wrong when it proceeds to the second (Windows) node.
I'd expect the PATH to be whatever the Windows PATH is currently set to on the node, plus the extra path I wanted to inject.
Attachments
Issue Links
- is related to
-
JENKINS-40338 Linux Master and Windows Slave ends up with unusable PATH
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
When having a pipeline task running over multiple nodes in sequence, the PATH environment is not reset when running on the next node. Here is a sample {code} node('linux'){ env.PATH = "${env.PATH}:/opt/myapp" echo "${env.PATH}" } node('windows'){ env.Path = "${env.PATH}:c:\\opt\\myapp" echo "${env.PATH}" } {code} Output: {code} [Pipeline] node Running on linux in /var/lib/jenkins/jobs/test-job/workspace [Pipeline] { [Pipeline] echo /sbin:/usr/sbin:/bin:/usr/bin:/opt/myapp [Pipeline] } [Pipeline] // node [Pipeline] node Running on windows in c:/jenkins-slave/workspace/test-job [Pipeline] { [Pipeline] echo /sbin:/usr/sbin:/bin:/usr/bin:/opt/myapp:c:\opt\myapp [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline Finished: SUCCESS {code} The PATH variable is wrong when it proceeds to the second (Windows) node. I'd expect the PATH to be whatever the Windows PATH is currently set to on the node, plus the extra path I wanted to inject. |
When having a pipeline task running over multiple nodes in sequence, the PATH environment is not reset when running on the next node. Here is a sample {code} node('linux'){ env.PATH = "${env.PATH}:/opt/myapp" echo "${env.PATH}" } node('windows'){ env.PATH = "${env.PATH}:c:\\opt\\myapp" echo "${env.PATH}" } {code} Output: {code} [Pipeline] node Running on linux in /var/lib/jenkins/jobs/test-job/workspace [Pipeline] { [Pipeline] echo /sbin:/usr/sbin:/bin:/usr/bin:/opt/myapp [Pipeline] } [Pipeline] // node [Pipeline] node Running on windows in c:/jenkins-slave/workspace/test-job [Pipeline] { [Pipeline] echo /sbin:/usr/sbin:/bin:/usr/bin:/opt/myapp:c:\opt\myapp [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline Finished: SUCCESS {code} The PATH variable is wrong when it proceeds to the second (Windows) node. I'd expect the PATH to be whatever the Windows PATH is currently set to on the node, plus the extra path I wanted to inject. |
Resolution | Not A Defect [ 7 ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |
Link |
This issue is related to |