Example of using a seed-all job with the Jenkins job DSL plugin
- Create a new job
- Name it "Seed All"
- can be anything, but must be same as contained in
seed_all.groovy
- can be anything, but must be same as contained in
- Choose "Freestyle project"
- Click "OK"
- Under "Source Code Management", choose "git"
- In "Repository URL", enter the URL of this repository
- Under "Build", click the "Add build step" drop-down and choose "Process Job DSLs"
- Select "Look on Filesystem"
- In "DSL Scripts", enter
jobs/seed_all.groovy
- Click "Save"
- Click "Build now"
- You should see a single job named "Seed All"
- Run the "Seed All" job
- The job will pull in the remote repo and replace itself using the configuration defined in seed_all.groovy
- Return to the dashboard.
- There should still only be a single job named "Seed All"
- Run the "Seed All" job
- The job will run again and create a job named "Hello World"
- Refresh the view (of the Dashboard)
- There should now be two jobs:
- the original "Seed All" job
- the new "Hello World" job
- There should now be two jobs: