Name: jenkins-job-builders
Owner: BBC
Description: Automated Jenkins job and view configuration, via the Jenkins Job DSL Plugin
Forked from: hmrc/jenkins-job-builders
Created: 2017-07-27 08:19:10.0
Updated: 2017-07-27 08:19:12.0
Pushed: 2017-07-27 10:52:04.0
Homepage: null
Size: 245
Language: Groovy
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Automated Jenkins job and view configuration builders, via the Jenkins Job DSL Plugin (wiki).
The problem with using a user interface for configuring a continuous build system like Jenkins is that it doesn't scale - teams should own their Jenkins configuration, but the normal approach in the user interface is to copy and paste jobs which quickly becomes unmaintainable when applying global fixes e.g. temporary diskspace management.
This can be solved in Jenkins by using the Jenkins Job DSL plugin, which allows job configuration to be automated and scales up to 10s/100s of jobs. Teams can configure their own microservice, frontend, stubs, and test jobs in their own product-specific configuration file, using a convenience Builder pattern that encapsulates the Jobs DSL (in Groovy). If and when the existing Builders are insufficient, the raw Jobs DSL can still be used.
JobBuilder
allows a job to be constructed from a series of SCM settings, publishers, and plugins. The raw Jobs DSL can be used if necessary.
ListViewBuilder
allows a job list to be constructed from a series of jobs. The raw Jobs DSL can be used if necessary.
BuildMonitorViewBuilder
allows a job monitor to be constructed from a series of jobs. The raw Jobs DSL can be used if necessary.
./gradlew clean test
locally to test your changes. The test suite will ensure the Builders are capable of producing the expected config XML for Jenkins.Create a Jenkins jobs repository akin to www.github.com/hmrc/jenkins-jobs, and then create a Jenkins job that weaves together this library with the jobs repository as follows:
The open HMRC Jenkins jobs are one example of how to use this library.
This code is open source software licensed under the Apache 2.0 License.