This project explains how to use the DSL plugin along with a seed job.
- Create a new Jenkins Job (Freestyle project) called 'seed'.
- In the SCM section, select
Git
and use asRepository URL
the URL of this repository. - In the
Build
section, add a new stepProcess Job DSLs
. - Enable the option
Look on Filesystem
and put the path to the job:jobs/*.groovy
- Build the job just created.
In case your Jenkins job fails due to the error ERROR: script not yet approved for use
, as admin user, you will need to approve your Groovy script. Go to Manage Jenkins -> In-process Script Approval. This is a Jenkins Security feature.
See this link and this on how to use a Groovy sandbox for the DSL plugin.