feat: allow custom MaaS download base URL
This commit is contained in:
parent
e778036d97
commit
c4544b24a5
|
@ -37,12 +37,17 @@ function file_url()
|
||||||
{
|
{
|
||||||
local release_version="$1"
|
local release_version="$1"
|
||||||
local filename="$2"
|
local filename="$2"
|
||||||
|
local baseurl="https://images.maas.io/ephemeral-v3/stable/"
|
||||||
|
|
||||||
if [ ! -f "$streams" ]; then
|
if [ ! -f "$streams" ]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
url=$(jq -r '.products[]|select(.version=="'"$OS_VERSION"'" and .arch=="amd64" and .kflavor=="generic" and .subarch=="ga-'"$OS_VERSION"'").versions."'"$release_version"'".items."'"$filename"'".path' \
|
url=$(jq -r '.products[]|select(.version=="'"$OS_VERSION"'" and .arch=="amd64" and .kflavor=="generic" and .subarch=="ga-'"$OS_VERSION"'").versions."'"$release_version"'".items."'"$filename"'".path' \
|
||||||
"$streams")
|
"$streams")
|
||||||
url="https://images.maas.io/ephemeral-v3/stable/$url"
|
if [ -n "$MAAS_DOWNLOAD_URL" ]; then
|
||||||
|
baseurl="$MAAS_DOWNLOAD_URL"
|
||||||
|
fi
|
||||||
|
url="$baseurl/$url"
|
||||||
}
|
}
|
||||||
|
|
||||||
function download_and_verify()
|
function download_and_verify()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user