yq:tldr:7aa22
This command is using the yq tool to evaluate and filter data from two YAML files based on a specific condition.
Here is the breakdown of the command:
-
yq eval-all: This command instructsyqto evaluate multiple expressions on multiple documents and merge the results. -
'select(filename == "${filename1-yaml}") * select(filename == "${filename2-yaml}")': This is the expression that will be evaluated byyq. It consists of two parts separated by*:-
select(filename == "${filename1-yaml}"): This selects all documents in the YAML file with a filename equal to the value of the environment variablefilename1-yaml. -
select(filename == "${filename2-yaml}"): This selects all documents in the YAML file with a filename equal to the value of the environment variablefilename2-yaml.
The expressions inside
select()are used to filter the documents based on the specified condition. -
-
${filename1-yaml} ${filename2-yaml}: These are the input files (YAML files) that will be processed byyq. The values of the environment variablesfilename1-yamlandfilename2-yamlwill be substituted here.
In summary, the command evaluates both input YAML files and selects documents from each file that have filenames matching the values of filename1-yaml and filename2-yaml. The merged results will be printed as the output.