Merge several YAML files and extract one value from the rightmost one #1943
-
Colleagues, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You can use the multiply
See https://mikefarah.gitbook.io/yq/operators/multiply-merge for different merge examples and options |
Beta Was this translation helpful? Give feedback.
Hello @mikefarah Can I supply the files to merge as command line parameters because 1) there maybe more than two and their number may vary and 2) their names can be variables and I'd avoid placing variables into single ticks?
Do I have to use the syntax
yq eval-all '. as $item ireduce ({}; . * $item ) | .image.phptests.tag' values*.yml
in this case?