↧
Answer by modle13 for How to define variable in Jenkins declarative pipeline?
You can also use environment block to inject an environment variable.(Side note: sh is not needed for echo)pipeline { agent none environment { FOO = "bar" } stages { stage("first") { steps { echo...
View ArticleAnswer by plmaheu for How to define variable in Jenkins declarative pipeline?
The variable must be defined in a script section.pipeline { agent none stages { stage("first") { steps { script { foo = "bar" } sh "echo ${foo}" } } }}
View ArticleHow to define variable in Jenkins declarative pipeline?
I defined variable in declarative Jenkins pipeline script but having issues with simple variable declaration.Here is my script:pipeline { agent none stages { stage("first") { def foo = "foo" // fails...
View Article
More Pages to Explore .....