Currently JCasC does not support YAML templating or inclusion in any means. For example, in https://github.com/oleg-nenashev/demo-jenkins-config-as-code/blob/master/init_scripts/src/main/groovy/scripts/Docker.groovy I create multiple Docker Cloud templates for different agent types. The configuration would be huge and difficult to maintain in JCasC.
I would suggest having an engine similar to what https://github.com/probot/probot-config does using Deepmerge:
- Independent YAML files can be created for configuration snippets and templates
- External configuration files can be referenced via
_extends notion at any level. Local files or other configuration providers (once implemented) can be referenced
- JCasC reads references when loading or validating configs
Currently JCasC does not support YAML templating or inclusion in any means. For example, in https://github.com/oleg-nenashev/demo-jenkins-config-as-code/blob/master/init_scripts/src/main/groovy/scripts/Docker.groovy I create multiple Docker Cloud templates for different agent types. The configuration would be huge and difficult to maintain in JCasC.
I would suggest having an engine similar to what https://github.com/probot/probot-config does using Deepmerge:
_extendsnotion at any level. Local files or other configuration providers (once implemented) can be referenced