-
Bug
-
Resolution: Unresolved
-
Major
Environments variables such as ${env.NODE_NAME} are not available in Options {} before stages. I want to dynamically lock a node using options {} before the first stage starts and keep that node locked for the entire pipeline.
I have spent hours on this everything I tried returns NULL. I know I can lock each stage individually but that won't work for me since it releases that lock at the end of each stage.
options {
lock (resource: "${env.NODE_NAME}")
}
stages {
stage("stage name") {
steps {.....
- is duplicated by
-
JENKINS-60367 Declarative Pipeline: Allow env vars to be used in options block
-
- Open
-
[JENKINS-55587] Env variables not available in pipeline options sections, outside of stages
Component/s | New: pipeline-model-definition-plugin [ 21706 ] | |
Component/s | Original: pipeline [ 21692 ] |
Sprint | Original: Declarative backlog [ 621 ] |
Rank | New: Ranked higher |
Link | New: This issue is duplicated by JENKINS-60367 [ JENKINS-60367 ] |