Add some comments to the fetch deps script.
Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
This commit is contained in:
@@ -22,13 +22,16 @@ trains=(
|
|||||||
download_deps() {
|
download_deps() {
|
||||||
local train_chart="$1"
|
local train_chart="$1"
|
||||||
|
|
||||||
|
# Extract dependencies for the Chart
|
||||||
deps=$(go-yq '.dependencies' "$charts_path/$train_chart/Chart.yaml")
|
deps=$(go-yq '.dependencies' "$charts_path/$train_chart/Chart.yaml")
|
||||||
|
# Find how many deps exist, so we can loop through them
|
||||||
length=$(echo "$deps" | go-yq '. | length')
|
length=$(echo "$deps" | go-yq '. | length')
|
||||||
|
|
||||||
echo "🔨 Processing <$charts_path/$train_chart>... 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
|
||||||
|
# Retrieve info for the dep in the current index..
|
||||||
curr_dep=$(echo "$deps" | pos="$idx" go-yq '.[env(pos)]')
|
curr_dep=$(echo "$deps" | pos="$idx" go-yq '.[env(pos)]')
|
||||||
|
|
||||||
if [ ! "$curr_dep" == null ]; then
|
if [ ! "$curr_dep" == null ]; then
|
||||||
@@ -49,6 +52,8 @@ for idx in $(eval echo "{0..$length}"); do
|
|||||||
|
|
||||||
repo_url="$repo/index.yaml"
|
repo_url="$repo/index.yaml"
|
||||||
echo "🤖 Calculating URL..."
|
echo "🤖 Calculating URL..."
|
||||||
|
# At the time of writing this, only 1 url existed (.urls[0]) pointing to the actual tgz.
|
||||||
|
# Extract url from repo_url. It's under .entries.DEP_NAME.urls. We filter the specific version first (.version)
|
||||||
dep_url=$(curl -s "$repo_url" | v="$version" n="$name" go-yq '.entries.[env(n)].[] | select (.version == env(v)) | .urls.[0]')
|
dep_url=$(curl -s "$repo_url" | v="$version" n="$name" go-yq '.entries.[env(n)].[] | select (.version == env(v)) | .urls.[0]')
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
@@ -83,7 +88,6 @@ for idx in $(eval echo "{0..$length}"); do
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo "--------"
|
|
||||||
}
|
}
|
||||||
export -f download_deps
|
export -f download_deps
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user