-
Notifications
You must be signed in to change notification settings - Fork 830
JCasC
Via configuratin-as-code-plugin also known as JCasC
It is possible to configure initial seed jobs through a yaml config file.
The basics for job dsl is you have a root element called jobs
that will be parsed to configure via job dsl
Examples of config file
jobs:
- script: >
multibranchPipelineJob('configuration-as-code') {
branchSources {
git {
id = 'configuration-as-code'
remote('https://github.com/jenkinsci/configuration-as-code-plugin.git')
}
}
}
You can also fetch your job dsl from a file or URL
jobs:
- file: ./jobdsl/job.groovy
jobs:
- url: https://raw.githubusercontent.com/jenkinsci/job-dsl-plugin/master/job-dsl-plugin/src/test/resources/javaposse/jobdsl/plugin/testjob.groovy
you can reference multiple scripts, files, and urls
jobs:
- script: >
job('testJob1') {
scm {
git('git://github.com/quidryan/aws-sdk-test.git')
}
triggers {
scm('H/15 * * * *')
}
steps {
maven('-e clean test')
}
}
- script: >
job('testJob2') {
scm {
git('git://github.com/quidryan/aws-sdk-test.git')
}
triggers {
scm('H/15 * * * *')
}
steps {
maven('-e clean test')
}
}
- file: ./jobdsl/job1.groovy
- file: ./jobdsl/job2.groovy
Stack Overflow | Mailing List | API Reference | Issue Tracker | Playground | Plugin | Wiki | GitHub
Home
Release Notes
Migration
Talks and Blog Posts
Documentation
Tutorial
Dynamic DSL
Configure Blocks
Job DSL Commands
Script Security
Handling Credentials
Configuration as Code
FAQ
Real World Examples
User Power Moves
IDE Support
Testing DSL Scripts
For Developers
Extending the DSL
Job DSL Architecture