chore(ci): fix cp path (#4387)
* chore(ci): fix a visual typo * fix copy.. * its train/chart :D
This commit is contained in:
@@ -8,7 +8,7 @@ command -v go-yq >/dev/null 2>&1 || {
|
|||||||
|
|
||||||
# define defaults
|
# define defaults
|
||||||
cache_path=${cache_path:-./tgz_cache}
|
cache_path=${cache_path:-./tgz_cache}
|
||||||
charts_ath=${charts_ath:-./charts}
|
charts_path=${charts_path:-./charts}
|
||||||
|
|
||||||
mkdir -p "$cache_path"
|
mkdir -p "$cache_path"
|
||||||
|
|
||||||
@@ -20,12 +20,12 @@ trains=(
|
|||||||
)
|
)
|
||||||
|
|
||||||
download_deps() {
|
download_deps() {
|
||||||
local charttrain="$1"
|
local train_chart="$1"
|
||||||
|
|
||||||
deps=$(go-yq '.dependencies' "$charts_ath/$charttrain/Chart.yaml")
|
deps=$(go-yq '.dependencies' "$charts_path/$train_chart/Chart.yaml")
|
||||||
length=$(echo "$deps" | go-yq '. | length')
|
length=$(echo "$deps" | go-yq '. | length')
|
||||||
|
|
||||||
echo "🔨 Processing <$charts_ath/$charttrain>... Dependencies: $length"
|
echo "🔨 Processing <$charts_path/$train_chart>... Dependencies: $length"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
for idx in $(eval echo "{0..$length}"); do
|
for idx in $(eval echo "{0..$length}"); do
|
||||||
@@ -56,7 +56,7 @@ for idx in $(eval echo "{0..$length}"); do
|
|||||||
wget --quiet "$dep_url" -P "$cache_path/"
|
wget --quiet "$dep_url" -P "$cache_path/"
|
||||||
if [ ! $? ]; then
|
if [ ! $? ]; then
|
||||||
echo "❌ wget encountered an error..."
|
echo "❌ wget encountered an error..."
|
||||||
helm dependency build "$charts_ath/$charttrain/Chart.yaml" || helm dependency update "$charts_ath/$charttrain/Chart.yaml" || exit 1
|
helm dependency build "$charts_path/$train_chart/Chart.yaml" || helm dependency update "$charts_path/$train_chart/Chart.yaml" || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$cache_path/$name-$version.tgz" ]; then
|
if [ -f "$cache_path/$name-$version.tgz" ]; then
|
||||||
@@ -64,14 +64,14 @@ for idx in $(eval echo "{0..$length}"); do
|
|||||||
else
|
else
|
||||||
echo "❌ Failed to download dependency"
|
echo "❌ Failed to download dependency"
|
||||||
# Try helm dependency build/update or otherwise fail fast if a dep fails to download...
|
# Try helm dependency build/update or otherwise fail fast if a dep fails to download...
|
||||||
helm dependency build "$charts_ath/$charttrain/Chart.yaml" || helm dependency update "$charts_ath/$charttrain/Chart.yaml" || exit 1
|
helm dependency build "$charts_path/$train_chart/Chart.yaml" || helm dependency update "$charts_path/$train_chart/Chart.yaml" || exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
mkdir -p "$charts_ath/$charttrain/charts"
|
mkdir -p "$charts_path/$train_chart/charts"
|
||||||
echo "📝 Copying dependency <$name-$version.tgz> to <$charts_ath/$charttrain/charts>..."
|
echo "📝 Copying dependency <$name-$version.tgz> to <$charts_path/$train_chart/charts>..."
|
||||||
cp "$cache_path/$name-$version.tgz" "$charttrain/charts"
|
cp "$cache_path/$name-$version.tgz" "$charts_path/$train_chart/charts"
|
||||||
|
|
||||||
if [ -f "$cache_path/$name-$version.tgz" ]; then
|
if [ -f "$cache_path/$name-$version.tgz" ]; then
|
||||||
echo "✅ Dependency copied!"
|
echo "✅ Dependency copied!"
|
||||||
@@ -79,7 +79,7 @@ for idx in $(eval echo "{0..$length}"); do
|
|||||||
else
|
else
|
||||||
echo "❌ Failed to copy dependency"
|
echo "❌ Failed to copy dependency"
|
||||||
# Try helm dependency build/update or otherwise fail fast if a dep fails to copy...
|
# Try helm dependency build/update or otherwise fail fast if a dep fails to copy...
|
||||||
helm dependency build "$charts_ath/$charttrain/Chart.yaml" || helm dependency update "$charts_ath/$charttrain/Chart.yaml" || exit 1
|
helm dependency build "$charts_path/$train_chart/Chart.yaml" || helm dependency update "$charts_path/$train_chart/Chart.yaml" || exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -89,7 +89,7 @@ export -f download_deps
|
|||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
for train in "${trains[@]}"; do
|
for train in "${trains[@]}"; do
|
||||||
for chart in $(ls "$charts_ath/$train"); do
|
for chart in $(ls "$charts_path/$train"); do
|
||||||
download_deps "${train}/${chart}"
|
download_deps "${train}/${chart}"
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ jobs:
|
|||||||
steps.collect-changes.outputs.changesDetectedAfterTag == 'true'
|
steps.collect-changes.outputs.changesDetectedAfterTag == 'true'
|
||||||
run: |
|
run: |
|
||||||
CHARTS=(${{ steps.collect-changes.outputs.modifiedChartsAfterTag }})
|
CHARTS=(${{ steps.collect-changes.outputs.modifiedChartsAfterTag }})
|
||||||
charts_ath="charts"
|
charts_path="charts"
|
||||||
for changed in ${CHARTS[@]}; do
|
for changed in ${CHARTS[@]}; do
|
||||||
.github/scripts/fetch_helm_deps.sh "${changed}"
|
.github/scripts/fetch_helm_deps.sh "${changed}"
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user