mirror of
https://github.com/k8s-at-home/charts.git
synced 2025-02-09 05:06:07 +00:00
refactoring changed check
This commit is contained in:
parent
4ad5b20e64
commit
4930cf60ec
@ -39,27 +39,21 @@ main() {
|
|||||||
|
|
||||||
echo "Identifying changed charts since tag '$latest_tag'..."
|
echo "Identifying changed charts since tag '$latest_tag'..."
|
||||||
|
|
||||||
local changed_charts=()
|
git diff --find-renames --name-only "$latest_tag_rev" -- . | cut -d '/' -f 1 | uniq > /tmp/modified_dirs.txt
|
||||||
git diff --find-renames --name-only comcast-1.0.5 -- . | cut -d '/' -f 1 | uniq > /tmp/modified_dirs.txt
|
|
||||||
while read -r dir; do
|
while read -r dir; do
|
||||||
echo "checking $dir"
|
|
||||||
if find "$dir" -type f -iname "Chart.yaml" | grep -E -q 'Chart.yaml'; then
|
if find "$dir" -type f -iname "Chart.yaml" | grep -E -q 'Chart.yaml'; then
|
||||||
changed_charts+=("$dir")
|
echo "Packaging chart '$dir'..."
|
||||||
|
package_chart "$dir"
|
||||||
fi
|
fi
|
||||||
done < /tmp/modified_dirs.txt
|
done < /tmp/modified_dirs.txt
|
||||||
rm /tmp/modified_dirs.txt
|
rm /tmp/modified_dirs.txt
|
||||||
|
|
||||||
if [[ -n "${changed_charts[*]}" ]]; then
|
if [[ -d .deploy ]]; then
|
||||||
for chart in "${changed_charts[@]}"; do
|
|
||||||
echo "Packaging chart '$chart'..."
|
|
||||||
package_chart "$chart"
|
|
||||||
done
|
|
||||||
|
|
||||||
release_charts
|
release_charts
|
||||||
sleep 5
|
sleep 5
|
||||||
update_index
|
update_index
|
||||||
else
|
else
|
||||||
echo "Nothing to do. No chart changes detected."
|
"Nothing to do. No chart changes detected."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
Loading…
Reference in New Issue
Block a user