Eliminate Xonsh usage Eliminate usage of the supports.yml files for default.nix Point ISOs directly to MinIO URLs instead
33 lines
734 B
Bash
Executable File
33 lines
734 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -eo pipefail
|
|
|
|
files=()
|
|
|
|
# These files are always out of date
|
|
rm -f cache/*latest* cache/*Rawhide* cache/openSUSE*Current*
|
|
|
|
# shellcheck disable=SC2044
|
|
for vars in $(find distros/ -name '*.pkrvars.hcl'); do
|
|
file=$(echo var.iso.url | packer console -var-file="${vars}" -config-type=hcl2 sources/)
|
|
base="$(basename "${file}")"
|
|
if [ -e "cache/${base}" ]; then
|
|
echo "Found cache/${base} already"
|
|
else
|
|
files+=("--retry" "3" "--retry-all-errors" "-O" "${file}")
|
|
fi
|
|
done
|
|
|
|
mkdir -p cache
|
|
pushd cache
|
|
echo "Downloading ${files[*]}"
|
|
curl --parallel -L "${files[@]}"
|
|
popd
|
|
|
|
ls -lh cache/
|
|
|
|
mc alias set storage "$STORAGE_URL" root "$MINIO_SECRET"
|
|
|
|
for f in cache/*; do
|
|
mc put "$f" "storage/isos/$f"
|
|
done
|