Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 1.52 KB

IMPLEMENTATION.md

File metadata and controls

37 lines (26 loc) · 1.52 KB

Jenkins Configuration as Code : implemntation details

Input configuration file uses a YAML hierarchical data structure. every node of this data structure is passed to a Configurator responsible to apply the adequate configuration on Jenkins live instance.

Configurator

A Configurator is managing a specific Jenkins Component, and as such knows about data this component exposes to end-user for configuration. It has:

  • a name to match a YAML entry,
  • a target component type (in most cases extension point implemented by component)
  • a describe method to document the attributes the target component exposes to configuraiton
  • a configure metod to configure the target component

Configurator selection

Root elements are identified by YAML entry name, and a matching RootElementConfigurator is selected.

Child elements are identified by YAML entry name AND expected attribute type, so in many case selecting the right Configurator is based on finding the matching implementation for a known set of candidates.

General purpose configurators

org.jenkinsci.plugins.casc.DescribableConfigurator can configure arbitrary jenkins component to implement Describable and rely on DataBoundConstructor and DataBoundSetters for UI data-binding. It uses same attributes names as the web UI, which are expected to be human friendly.

org.jenkinsci.plugins.casc.DescriptorRootElementConfigurator can configure global configuration for Descriptors, to mimic the global.jelly UI exposed to end user on the web UI.