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 prefix of the temporary directory on Jenkins master 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, 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 prefix of the temporary directory on Jenkins master for the XML files generated on the node. They have to be copied to the Jenkins master in order to apply them. The job will try to delete the temporary directory after done, logging an error in case that this is not possible.
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