question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JCasC templating and inheritance support

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:13
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
jetersencommented, Oct 7, 2019

file order should already be taken into account

1reaction
bioshazardcommented, Mar 26, 2020

Found this issue while trying to determine how best to atomize my many many jobs outside of a single gigantic jenkins.yaml, is it possible or on the roadmap? (EDIT: I will be leveraging Ansible and Jinja to compile the resulting jenkins.yaml for now to get the include functionality I want)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced CasC topics for controllers
Configuring bundle inheritance with CasC. You can simplify bundle composition and maintenance by creating a "child" bundle that inherits common configuration ...
Read more >
2.0 Upgrade Guide :: Solutions Delivery Platform
Jenkins Templating Engine · 2.0 Upgrade Guide ... In order to support library resources, the file structure of libraries has been reorganized.
Read more >
Jenkins Configuration as Code
With JCasC, setting up a new Jenkins controller will become a no-brainer event. ... No need to write glue code for every supported...
Read more >
jenkinsci/templating-engine-plugin - Gitter
pipeline template node() build() # project pipeline config libraries ... “not in JTE” template{ // will load whatever configuration has been inherited by ......
Read more >
CloudBees CI Configuration Bundle Inheritance and ...
yaml file) into two files and put those files in a jcasc folder to make the configuration files easier to manage. The items...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found