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

Popular posts from this blog

Receive udp packets in android gstreamer -

php - Extract Text from HTTP referer -

java - Callback from new thread to class from which thread was initiated -