better chart check upfront

This commit is contained in:
Jeff Billimek 2019-08-04 23:53:45 -04:00
parent 7f0177fed4
commit 85b73933b4

View File

@ -40,21 +40,17 @@ main() {
echo "Identifying changed charts since tag '$latest_tag'..." echo "Identifying changed charts since tag '$latest_tag'..."
local changed_charts=() local changed_charts=()
readarray -t changed_charts <<< "$(git diff --find-renames --name-only "$latest_tag_rev" -- . | cut -d '/' -f 1 | uniq)" readarray -t changed_charts <<< "$(find $(git diff --find-renames --name-only $latest_tag_rev -- .) -type f -iname 'Chart.yaml' | cut -d '/' -f 1 | uniq)"
if [[ -n "${changed_charts[*]}" ]]; then if [[ -n "${changed_charts[*]}" ]]; then
for chart in "${changed_charts[@]}"; do for chart in "${changed_charts[@]}"; do
if find "$chart" -type f -iname "Chart.yaml" | grep -E -q '.'; then echo "Packaging chart '$chart'..."
echo "$chart is a valid chart directory - packaging"
package_chart "$chart" package_chart "$chart"
fi
done done
if [[ -d .deploy ]]; then release_charts
release_charts sleep 5
sleep 5 update_index
update_index
fi
else else
echo "Nothing to do. No chart changes detected." echo "Nothing to do. No chart changes detected."
fi fi