Skip to content

Commit

Permalink
Make create-consolidated-values.sh more portable (#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
BradLugo authored Mar 14, 2023
1 parent 45b4223 commit a742750
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions scripts/create-consolidated-values.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,13 @@ create_consolidated_values() {
} >> "$values_file"

pushd "$ROOT/chart/infra-server/configuration/$environment" > /dev/null
shopt -s globstar nullglob
for cfg_file in **; do
if [[ -d "$cfg_file" ]]; then
continue
fi
if [[ "$cfg_file" =~ (README|DS_Store) ]]; then
continue
fi

local helm_safe_key="${cfg_file//[.-]/_}"
helm_safe_key="${helm_safe_key////__}"

echo "$helm_safe_key: $(base64 < "$cfg_file" | tr -d '\n')" >> "$values_file"
echo >> "$values_file"
done
while IFS='' read -r cfg_file; do
local helm_safe_key="${cfg_file//[.-]/_}"
helm_safe_key="${helm_safe_key////__}"

echo "$helm_safe_key: $(base64 < "$cfg_file" | tr -d '\n')" >> "$values_file"
echo >> "$values_file"
done < <(find . -type f -not -name '*.md' -not -name '*.DS_Store' | cut -c3-)
popd > /dev/null
}

Expand Down

0 comments on commit a742750

Please sign in to comment.