Created
September 10, 2020 06:20
-
-
Save whereisaaron/8aa074c882f388e17503122a19fd987a to your computer and use it in GitHub Desktop.
Convert JSON object to YAML values for a helm chart
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
#!/bin/bash | |
json_to_values() { | |
json=$1 | |
echo "env:" | |
jq -r 'to_entries | .[] | " - name: \(.key)\n value: '"'"'\(.value)'"'"'"' <<<$json | |
} | |
read -r -d '' foo << END | |
{ | |
"FOO": "bar bar", | |
"BAZ": "hhh", | |
"CHEESE": "Hello world" | |
} | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment