-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sean Krail
committed
Mar 27, 2020
1 parent
68d8653
commit 0e90f64
Showing
2 changed files
with
14 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,16 @@ | ||
#!/bin/bash | ||
set -eo pipefail | ||
|
||
echo "Bundling all of the charts..." | ||
|
||
# Convert the definitions YAML-based JSON schema into JSON | ||
yml2json definitions.schema.yaml --output definitions.schema.json | ||
echo -n "Bundling all of the charts..." | ||
|
||
# Loop through every chart | ||
for chart in charts/*; do | ||
# Convert the values YAML-based JSON schema into JSON | ||
yml2json "${chart}"/values.schema.yaml --output "${chart}"/values-temp.schema.json | ||
|
||
# Combine the values.schema.json and definitions.schema.json files | ||
# with the values.schema.json file taking precedence recursively | ||
# See https://stedolan.github.io/jq/manual/#Multiplication,division,modulo:*,/,and% | ||
jq --compact-output --slurp '.[0] * .[1]' definitions.schema.json "${chart}"/values-temp.schema.json > "${chart}"/values.schema.json | ||
|
||
# Remove the temporary JSON schema file | ||
rm "${chart}"/values-temp.schema.json | ||
# Combine the definitions.schema.yaml and charts/$chart/values.schema.yaml files | ||
# with the charts/$chart/values.schema.yaml file taking precedence | ||
# and output the merged YAML document as JSON. | ||
# See https://mikefarah.gitbook.io/yq/commands/merge | ||
# and https://mikefarah.gitbook.io/yq/usage/convert | ||
yq merge --overwrite --tojson definitions.schema.yaml "${chart}"/values.schema.yaml > "${chart}"/values.schema.json | ||
done | ||
|
||
echo "done" |