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

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -