Generating multiple files with custom values #1037
-
Hi! I am evaluating Pkl for a use-case that I have around generating YAML files for Prometheus. I have a folder structure like this:
I have my pkl setup (simplified) like this:
What I am looking to achieve is something like the following:
and the output should look something like: # base/app1.yaml
myValue: 10 # overlays/env1/app1.yaml
myValue: 20 and then env2/app1.yaml shouldn't exist since it wasn't configured in the environments. However, app2 for instance might have it configured. I could likely do something like:
however, I'm not sure if this is ideal as the block is quite large and dumping it all in the output seems wrong. What I would expect to work is something like:
Additional context: I generate 3 different files for each application, this is currently being done by having output.files configured for three different files with value = object1, object2, object3 each application might have different values per environment so the number of yaml files needed will always be 3 * (number of environments + 1), as base is always generated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
Would you be able to share (at least a reduced portion of) your spec.pkl? Understanding how you've laid out the types for the top-level |
Beta Was this translation helpful? Give feedback.
Gotcha, iterating on this a little more: