How to set variables in a multi-line shell script within Jenkins Groovy? -
suppose have groovy script in jenkins contains multi-line shell script. how can set , use variable within script? normal way produces error:
sh """ foo='bar' echo $foo """ caught: groovy.lang.missingpropertyexception: no such property: foo class: groovy.lang.binding
you need change triple single quotes ''' or escape dollar \$
then you'll skip groovy templating what's giving issue
Comments
Post a Comment