We're using the Jenkins Job DSL plugin to configure all our jobs in code, and often use a local Jenkins staging environment to test in before deploying changes. We don't want our whole slew of hundreds of jobs to start building locally, though we do want to make sure the DSL is valid and the jobs are all created correctly.
Is there a way to override for example the scm
parameter of a trigger
so that it is a no-op locally, across all of our groovy files? I believe I could write a custom library file that does this, but then I'd have to add an import line to every groovy file to import our custom scm
definition, which isn't ideal.
To clarify, I'm looking for a way to override certain definitions, elegantly or by monkey patching code, so that we don't have to require a change to every groovy file and job definition, of which there are a lot.