chore(ci): fix cp path (#4387)

* chore(ci): fix a visual typo

* fix copy..

* its train/chart :D
This commit is contained in:
Stavros Kois
2022-11-12 17:58:44 +02:00
committed by GitHub
parent 37ea4a1920
commit dcc7fe5ed3
2 changed files with 16 additions and 16 deletions

View File

@@ -8,7 +8,7 @@ command -v go-yq >/dev/null 2>&1 || {
# define defaults
cache_path=${cache_path:-./tgz_cache}
charts_ath=${charts_ath:-./charts}
charts_path=${charts_path:-./charts}
mkdir -p "$cache_path"
@@ -20,12 +20,12 @@ trains=(
)
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')
echo "🔨 Processing <$charts_ath/$charttrain>... Dependencies: $length"
echo "🔨 Processing <$charts_path/$train_chart>... Dependencies: $length"
echo ""
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/"
if [ ! $? ]; then
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
if [ -f "$cache_path/$name-$version.tgz" ]; then
@@ -64,14 +64,14 @@ for idx in $(eval echo "{0..$length}"); do
else
echo "❌ Failed to download dependency"
# 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
echo ""
mkdir -p "$charts_ath/$charttrain/charts"
echo "📝 Copying dependency <$name-$version.tgz> to <$charts_ath/$charttrain/charts>..."
cp "$cache_path/$name-$version.tgz" "$charttrain/charts"
mkdir -p "$charts_path/$train_chart/charts"
echo "📝 Copying dependency <$name-$version.tgz> to <$charts_path/$train_chart/charts>..."
cp "$cache_path/$name-$version.tgz" "$charts_path/$train_chart/charts"
if [ -f "$cache_path/$name-$version.tgz" ]; then
echo "✅ Dependency copied!"
@@ -79,7 +79,7 @@ for idx in $(eval echo "{0..$length}"); do
else
echo "❌ Failed to copy dependency"
# 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
done
@@ -87,9 +87,9 @@ echo "--------"
}
export -f download_deps
if [ -z "$1" ]; then
if [ -z "$1" ]; then
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}"
done
done