Skip to content

Instantly share code, notes, and snippets.

@danie7k
danie7k / QuotesInJenkinsfiles.groovy
Created April 17, 2025 20:20 — forked from agarthetiger/QuotesInJenkinsfiles.groovy
Quoting strings and variable interpolation in Jenkinsfiles, passing values to shell tasks.
node{
timestamps{
stage('Samples'){
// Single quotes with no interpolation, at least not in Jenkins.
// The dollar variable will be evaluated before being run by the
// shell command, so variables which Jenkins makes available as
// environment variables can still be accessed from within a
// single-quoted string, passed to the sh task.
sh 'echo $PATH'