A JobBuilder that creates a seed job that runs the dslGenerateXml Gradle task to create the XML files and
then uses a system groovy script build step to update the jobs. This is a replacement for using the dslUpdateJenkins
task in a seed job and promises a much better performance because it uses the internal Jenkins API instead of the
REST API.
The builder does not provide a default way to get the files of the Gradle project, this has to be added by calling
JobBuilder.addDsl. Usually this will be a copy artifacts step or a SCM configuration.
| Type | Name and description |
|---|---|
java.lang.String |
generateXmlScriptProvide the script that will execute the dslGenerateXml Gradle task for your project. |
java.lang.String |
seedJobGroovyScriptThe Groovy script that updates the jobs from the XML files, executed in a System Groovy Script build step. |
java.lang.String |
temporaryXmlDirPrefixThe path on Jenkins master to use as temporary folder for the XML files generated on the node. |
java.lang.String |
xmlBaseDirThe base directory where the generated XML files are located. |
| Constructor and description |
|---|
GroovySeedJobBuilder
(javaposse.jobdsl.dsl.DslFactory dslFactory) |
| Methods inherited from class | Name |
|---|---|
class JobBuilder |
addDsl, addFreeStyleDsl, addMatrixDsl, addMavenDsl, addMultiDsl, addPipelineDsl, build, buildFlowJob, checkJobClassNull, checkNameIsValid, concatenateDslClosures, freeStyleJob, fullJobName, matrixJob, mavenJob, multiJob, pipelineJob |
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Provide the script that will execute the dslGenerateXml Gradle task for your project. It defaults to the basic
"./gradlew --no-daemon dslGenerateXml" which will only work if your project is present in the workspace directory
and does not use server configuration.
Set this to null if you get the XML files in another way, for example by copying them from another job.
The Groovy script that updates the jobs from the XML files, executed in a System Groovy Script build step.
All items (folders and jobs) are compared and only updated when the XML has changed. Folders that contain views
will always be updated.
Views in the Jenkins root will always be updated, views inside folders will always be re-created.
Only change this value if you know what you are doing!
The path on Jenkins master to use as temporary folder for the XML files generated on the node. The have to be copied to the Jenkins master in order to apply them. The build number of the seed job will be added to the prefix, also the job will fail when the folder already exists and delete it after generating the jobs.
The base directory where the generated XML files are located. Usually this is the build/jobdsl/xml folder in the Gradle project. This value is used by the default seedJobGroovyScript, if you change the script you have to include the string XML_BASE_DIR_PLACEHOLDER which will be replaced by xmlBaseDir automatically.
Groovy Documentation