-
Bug
-
Resolution: Fixed
-
Minor
-
Jenkins ver. 2.32.1
Pipeline 2.5
EnvInject 1.2
After upgrading to latest Pipeline version and it's dependencies (we also upgraded the blue ocean plugins but don't think that caused an issue here), we noticed that the PATH was not getting set in our Jenkins Pipeline Jobs. After debugging found that if I set PATH to a string inside the "environment" section, as such:
environment
{ PATH="/a/new/bin:$PATH" }
The PATH was updated successfully without any issues. However if I introduce a variable, the path does not get updated, and defaults to what is on the agent that runs the job. Example:
pipeline
{ agent
environment {
PATH="/a/new/bin:${env.SCM_HOME}:$PATH"
SCM_HOME="${env.SCM_HOME}"
}
stages {
stage ('build') {
steps
}
}
}
OUTPUT:
[Pipeline] {
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (build)
[Pipeline] echoPATH=/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin
[Pipeline] echoSCM_HOME=/usr/local/bin/scmtools/
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of PipelineFinished: SUCCESS
Notice that SCM_HOME resolves fine outside of PATH and that /a/new/bin was not added to the path. However if I drop the variable it will set PATH fine.
- depends on
-
JENKINS-42753 Generate runtime model directly from AST model
- Closed