An example Job DSL project that uses Gradle for building and testing. Check out this presentation for a walkthrough of this example (starts around 14:00).
.
├── src
│ ├── jobs # DSL script files
│ ├── main
│ │ ├── groovy # support classes
│ │ └── resources
│ │ └── idea.gdsl # IDE support for IDEA
│ ├── scripts # scripts to use with "readFileFromWorkspace"
│ └── test
│ └── groovy # specs
└── build.gradle # build file
You can create the example seed job via the Rest API Runner (see below) using the pattern jobs/seed.groovy
.
Or manually create a job with the same structure:
- Invoke Gradle script
- Use Gradle Wrapper:
true
- Tasks:
clean test
- Use Gradle Wrapper:
- Process Job DSLs
- DSL Scripts:
src/jobs/**/*Jobs.groovy
- Additional classpath:
src/main/groovy
- DSL Scripts:
- Publish JUnit test result report
- Test report XMLs:
build/test-results/**/*.xml
- Test report XMLs:
Note that starting with Job DSL 1.60 the "Additional classpath" setting is not available when Job DSL script security is enabled.
- Job DSL Playground - App for debugging Job DSL scripts.
- Job DSL API Viewer - Full Job DSL syntax reference.
- Job DSL REST Example - Example that shows how to make Job DSL updates via the Jenkins REST API. Originally part of this repo, later split off.
Plugins that automatically apply the functionality laid out in this example repo.
- Gradle Job DSL Support Plugin - Plugin for easy management of Jenkins Job DSL scripts with Gradle.
- Gradle Jenkins Job DSL Plugin - Plugin to manage Jenkins Job DSL projects in a Gradle project.