--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugi...@googlegroups.com.
To post to this group, send email to job-dsl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/bf90b74c-a68f-45da-816c-5e8f9f2498a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/CAKqW32BqJwDbPXgFVgYfpb0zKCpoNf40OhxaJkktP7z4Xumfzw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/CAL%3DX-wWf1Z%3DxirJWbQf4Z3mcZen-ScPAeKpkNRWDdCSUNfnWcA%40mail.gmail.com.
I have seen that people use MessageFormat or String.format to create script template. But that usually ends up in an escaping hell. For example for GString you would have to escape all dollar signs, so every shell variable you use in a script. And you probably have to escape backslashes as well and if you need to escape the backslashes in a normal script, e.g. in grep, you have to add double escaping.
So, in my point of view, using environment variable is a nice and clean solution to pass variables to script. Another solution would be to add DSL support for the Managed Script Plugin (https://wiki.jenkins-ci.org/display/JENKINS/Managed+Script+Plugin), because that allows to pass parameters to scripts.