-
Bug
-
Resolution: Unresolved
-
Major
-
Jenkins 2.41
Durable task plugin 1.13
Centos 6.5
This seems to have broken fairly recently. I have a global PATH environment variable defined in Jenkins as follows:
PATH: /path/to/toolchain/bin:$PATH
Freestyle jobs work with this. An older version of the durable task plugin also worked. After updating to the latest, this pipeline job:
node('master', { echo 'env.PATH=' + env.PATH sh('env') })
results in this output:
[Pipeline] node Running on master in /var/lib/jenkins/workspace/pipeline bug [Pipeline] { [Pipeline] echo env.PATH=/path/to/toolchain/bin:$PATH [Pipeline] sh [pipeline bug] Running shell script nohup: failed to run command ‘sh’: No such file or directory [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline ERROR: script returned exit code -2 Finished: FAILURE
- blocks
-
JENKINS-40734 Shell step cannot use environment variables that contain $$
-
- Resolved
-
- is duplicated by
-
JENKINS-41227 can't run pipline job on older OS
-
- Resolved
-
- is related to
-
JENKINS-41492 Global environment variable help needs update for prepending keys
-
- Open
-
-
JENKINS-40484 Unable to use withMaven() step inside docker container for old versions of Docker
-
- Reopened
-
- relates to
-
JENKINS-45616 Multi-branch pipelines do not interpolate platform environment variables into Jenkins global environment variables
-
- Open
-
-
JENKINS-28990 Node environment variables not recursively expanded
-
- Resolved
-
-
JENKINS-42671 Durable Task 1.13 does not have the compatibleSince definition in POM
-
- Closed
-
- links to
As oleg_nenashev pointed out, this doesn't only affect the PATH but other Global environment variables as well.
If I were to define for example Global environment variable NODE_TMP=/tmp/${NODE_NAME}
Then Create Freestyle project and Pipeline one with only one step that does env
Then run both projects on master:
In Console Output of the Freestyle build, I would see NODE_TMP=/tmp/master
while in Console Output of the Pipeline it would be NODE_TMP=/tmp/${NODE_NAME}