Hi, Daniel.
If I understand, you are suggesting that I:
1) modify my job generator script (the script that I want to run more than once, using a parameter to determine whether a 'ITG' or 'PRO' build job is created) to read an environment variable that would contain the appropriate value ('test' or 'prod'), and
2) modify my seed job to set the parameter to one of the two values, run the job generator script, reset the parameter to the other value, and then run the job generator script again.
Unfortunately, that doesn't seem to work, or more likely, I'm doing it incorrectly. Below is a snip of my DSL code that generates my seed job (yes, I'm also using DSL to create my seed job). When I then look at the seed job configuration I see the parameter being set, then immediately reset, and only one generated job is created, using the 2nd value of the parameter.
I think part of my problem is that the same job generator DSL script is being run more than once, and I have no way of having it read different env vars during different executions.
Thanks.
// Set a parameter to create ITG build jobs.
parameters {
stringParam('myEnv', 'ITG', 'ITG or PRO')
}
// Create the build steps to build the PWAXApps jobs.
steps {
dsl {
external('PWAXAppsWebTestGenerator.groovy')
removeAction('DELETE')
removeViewAction('DELETE')
}
}
// Reset the parameter to create PRO build jobs.
parameters {
stringParam('myEnv', 'PRO', 'ITG or PRO')
}
// Create the build steps to build the PWAXApps jobs.
steps {
dsl {
external('PWAXAppsWebTestGenerator.groovy')
removeAction('DELETE')
removeViewAction('DELETE')
}
}