#!/bin/bashset -xeuTEST_OS="$1"TEST_COMPOSE="$2"RELEASE="$3"# Check if file already existsif [ -f test/images/"$TEST_COMPOSE".iso ]; thenecho "$TEST_COMPOSE.iso already exists"exit 0fiCOMPOSE_BASE_URL=$(python3 test/helpers/compose_path.py "$TEST_COMPOSE")ISO_FOLDER="${COMPOSE_BASE_URL}/compose/Server/x86_64/iso"ISO=$(curl -L --silent ${ISO_FOLDER} | grep -oP 'href="\K[^"]+' | grep -E '\.iso' | head -n1 | tr -d '\n')URL="$ISO_FOLDER/$ISO"pushd test/imagescurl -L "$URL" -o "$TEST_COMPOSE".isopopd