load input files dynamically #3223
-
Hello, is possible to load input files dynamically from the first input file. First input file would be: vars:
REPOSITORY_URL: https://github.com/fchastanet/bash-tools-framework
includes:
- path/fileToinclude1.yaml
- path/fileToinclude2.yaml path/fileToinclude1.yaml content: binFile:
relativeRootDirBasedOnTargetDir: ..
templateFile: binFile.gtpl path/fileToinclude2.yaml content: vars:
MAIN_FUNCTION_NAME: main The resulting file would be: vars:
REPOSITORY_URL: https://github.com/fchastanet/bash-tools-framework
MAIN_FUNCTION_NAME: main
binFile:
relativeRootDirBasedOnTargetDir: ..
templateFile: binFile.gtpl So in cue file, I could have something like # provide first input file
input: _
mergeIncludes: {
for _content in input.includes {
_content
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@fchastanet Is the set of files that might be referenced inside |
Beta Was this translation helpful? Give feedback.
-
Finally I defined my own yaml format by adding this extends key |
Beta Was this translation helpful? Give feedback.
Finally I defined my own yaml format by adding this extends key
I preprocess the yaml file using "github.com/goccy/go-yaml" generating final yaml file
and then I load it into cue