Skip to content

Instantly share code, notes, and snippets.

@adampats
Created March 15, 2017 04:44
Show Gist options
  • Save adampats/1cac39f2aee8bbb8bba0a05abf4c2b90 to your computer and use it in GitHub Desktop.
Save adampats/1cac39f2aee8bbb8bba0a05abf4c2b90 to your computer and use it in GitHub Desktop.
Groovy / Jenkinsfile create variable name from arbitrary string
// requires Jenkins - Groovy Sandbox to be turned OFF
new_var = "varname"
new GroovyShell(this.binding).evaluate("${new_var} = 'skittles'")
println varname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment