jenkinsci / jenkinsci/configuration-as-code-plugin
JCasC templating and inheritance support
- Dominant language
- Java
- Stars
- 2.8k
- Forks
- 756
- Avg merge
- 9h 47m
- Merged PRs (30d)
- 10
Description
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](https://www.npmjs.com/package/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
Contributor guide
Assessment
This issue has not been assessed yet.