https://github.com/sheehan/job-dsl-rest-example
An example Job DSL project that shows how to make Job DSL updates via the Jenkins REST API.
https://github.com/sheehan/job-dsl-rest-example
groovy jenkins job-dsl
Last synced: 9 months ago
JSON representation
An example Job DSL project that shows how to make Job DSL updates via the Jenkins REST API.
- Host: GitHub
- URL: https://github.com/sheehan/job-dsl-rest-example
- Owner: sheehan
- License: apache-2.0
- Created: 2017-10-29T19:07:19.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-07T21:44:25.000Z (over 8 years ago)
- Last Synced: 2025-04-10T12:40:22.928Z (over 1 year ago)
- Topics: groovy, jenkins, job-dsl
- Language: Groovy
- Homepage:
- Size: 58.6 KB
- Stars: 15
- Watchers: 1
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Jenkins Job DSL Rest Example
An example [Job DSL](https://github.com/jenkinsci/job-dsl-plugin) project that shows how to make Job DSL updates via the Jenkins REST API.
The project layout is based on the [Job DSL Gradle Example](https://github.com/sheehan/job-dsl-gradle-example).
## REST API Runner
Note: the REST API Runner does not work with [Automatically Generated DSL](https://github.com/jenkinsci/job-dsl-plugin/wiki/Automatically-Generated-DSL).
A gradle task is configured that can be used to create/update jobs via the Jenkins REST API, if desired. Normally
a seed job is used to keep jobs in sync with the DSL, but this runner might be useful if you'd rather process the
DSL outside of the Jenkins environment or if you want to create the seed job from a DSL script.
```./gradlew rest -Dpattern= -DbaseUrl= [-Dusername=] [-Dpassword=]```
* `pattern` - ant-style path pattern of files to include. E.g. `src/jobs/*.groovy`
* `baseUrl` - base URL of Jenkins server
* `username` - Jenkins username, if secured
* `password` - Jenkins password or token, if secured