Thanks a ton Victor! The link you referred me to got me pointed in the 
right direction.

I removed the environmentVariables/groovy() call and added the configure 
block below.

    def testJob(){

        this.jobFactory.job("Tests/testJob"){

            parameters {

                booleanParam("DRYRUN", true, "Check to dryrun.")

            }

            environmentVariables{

                env("ONE", 1)

            }

            steps{

                shell(*'echo RUN=$RUN'*)

            }

            configure{ configurationXML ->

              configurationXML / 'properties' / 'EnvInjectJobProperty' / 
'info' / 'secureGroovyScript' / script("return [RUN: DRYRUN == 'true' ? ' 
--dryrun ' : '']")

              configurationXML / 'properties' / 'EnvInjectJobProperty' / 
'info' / 'secureGroovyScript' / sandbox(true)

            }

        }

    }


On Thursday, May 10, 2018 at 1:12:15 AM UTC-7, Victor Martinez wrote:
>
> Does it help the below answer? 
> - 
> https://groups.google.com/forum/#!searchin/job-dsl-plugin/Use$20Groovy$20Sandbox%7Csort:date/job-dsl-plugin/UiD7ujvEQ-s/HvgRrAiJAwAJ
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e41590de-2cb8-41c5-8955-8b84980af578%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to