Quantcast
Channel: How to define variable in Jenkins declarative pipeline? - DevOps Stack Exchange
Browsing latest articles
Browse All 3 View Live

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 Article


Answer 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 Article

How 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
Browsing latest articles
Browse All 3 View Live




<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>