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 -

python - GitPython: check if git is available -

How to merge four videos on one screen with ffmpeg -