Created
March 15, 2017 04:44
-
-
Save adampats/1cac39f2aee8bbb8bba0a05abf4c2b90 to your computer and use it in GitHub Desktop.
Groovy / Jenkinsfile create variable name from arbitrary string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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