Jenkins Job Builder takes simple descriptions of Jenkins jobs in YAML or JSON format and uses them to configure Jenkins. You can keep your job descriptions in human readable text format in a version control system to make changes and auditing easier. It also has a flexible template system, so creating many similarly configured jobs is easy.
Jenkins Job builder creates Jenkins XML configuration file from a YAML/JSON definition file and uploads it to Jenkins. JJB provides a convenient test command to allow you to validate the XML before you attempt to upload it to Jenkins.
An example job definition
- job:
name: job-name
project-type: freestyle
defaults: global
description: 'Do not edit this job through the web!'
disabled: false
display-name: 'Fancy job name'
concurrent: true
workspace: /srv/build-area/job-name
quiet-period: 5
block-downstream: false
block-upstream: false
retry-count: 3
node: NodeLabel1 || NodeLabel2
logrotate:
daysToKeep: 3
numToKeep: 20
artifactDaysToKeep: -1
artifactNumToKeep: -1
Once you’ve tested your job definition and are happy with it then you can use the update command to deploy the job to Jenkins.
jenkins-jobs update tests/yamlparser/fixtures/templates002.yaml
It will then appear in the UI of your Jenkins instance and can be run, viewed etc as any other job.
Online documentation: http://docs.openstack.org/infra/jenkins-job-builder/