Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 1.06 KB

mergeStrategy.md

File metadata and controls

26 lines (17 loc) · 1.06 KB

Merge Strategy

It's possible to load multiple config files. CasC can load YAML files from a directory. And it's convenient to maintain if we split different parts of Jenkins into multiple files.

Supported strategies

  • ErrorOnConflictMergeStrategy (default)
    • The strategy name is errorOnConflict.
    • Throws an exception if there's a conflict in multiple YAML files.
  • OverrideMergeStrategy
    • The strategy name is override
    • Override the config files according to the loading order.

Use cases

You can provide two YAML config files. They can be system and user config files. Then allow users to change their file and override the system configuration.

How to

There are two ways to configure the strategy name.

  • set the environment CASC_MERGE_STRATEGY
  • set the system property casc.merge.strategy

The strategy name could be errorOnConflict or override.