-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins 2.289.2
pipeline-build-step 2.13
pipeline-graph-analysis 1.11
pipeline-input-step 2.12
pipeline-milestone-step 1.3.2
pipeline-model-api 1.8.5
pipeline-model-definition 1.8.5
pipeline-model-extensions 1.8.5
pipeline-rest-api 2.19
pipeline-stage-step 2.5
pipeline-stage-tags-metadata 1.8.5
pipeline-stage-view 2.19
pipeline-utility-steps 2.8.0Jenkins 2.289.2 pipeline-build-step 2.13 pipeline-graph-analysis 1.11 pipeline-input-step 2.12 pipeline-milestone-step 1.3.2 pipeline-model-api 1.8.5 pipeline-model-definition 1.8.5 pipeline-model-extensions 1.8.5 pipeline-rest-api 2.19 pipeline-stage-step 2.5 pipeline-stage-tags-metadata 1.8.5 pipeline-stage-view 2.19 pipeline-utility-steps 2.8.0
Consider the following declarative Pipeline:
pipeline { agent { node { label 'blunt' customWorkspace 'slot' + env.EXECUTOR_NUMBER } } stages { stage('Build') { steps { sh 'echo $WORKSPACE' } } } }
The (curtailed) console output is:
Running on blunt in /build/jenkins/workspace/pipeline-test Running in /build/jenkins/slotnull + echo /build/jenkins/slotnull
What I would have expected instead (assuming 'blunt' is a single-executor node):
Running on blunt in /build/jenkins/slot0 + echo /build/jenkins/slot0
One can somewhat work around this with ws steps, but with more complicated pipelines where multiple steps in multiple stages need to share the same custom workspace, that can get unwieldy.
Other environment variables, like NODE_NAME, also evaluate to null in the same context.