diff --git a/acceptance-tests/run-local.sh b/acceptance-tests/run-local.sh index 3aebe8f3..db94e5e2 100755 --- a/acceptance-tests/run-local.sh +++ b/acceptance-tests/run-local.sh @@ -31,16 +31,28 @@ docker_mac_check_cgroupsv1() { check_required_files() { REQUIRED_FILE_PATTERNS=( - ../ci/scripts/bpm/bpm-release-*.tgz - ../ci/scripts/stemcell/bosh-stemcell-*-ubuntu-jammy-*.tgz - ../ci/scripts/stemcell-bionic/bosh-stemcell-*-ubuntu-bionic-*.tgz + ../ci/scripts/bpm/bpm-release-*.tgz!https://bosh.io/d/github.com/cloudfoundry/bpm-release + ../ci/scripts/stemcell/bosh-stemcell-*-ubuntu-jammy-*.tgz!https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-jammy-go_agent + ../ci/scripts/stemcell-bionic/bosh-stemcell-*-ubuntu-bionic-*.tgz!https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-bionic-go_agent ) - for pattern in "${REQUIRED_FILE_PATTERNS[@]}"; do - if [ ! -f "$pattern" ]; then - echo "Required file not found: {$pattern}" - exit 1 + for entry in "${REQUIRED_FILE_PATTERNS[@]}"; do + # shellcheck disable=SC2206 + tuple=( ${entry//!/ } ) + + pattern=${tuple[0]} + url=${tuple[1]} + + if [ -f "$pattern" ]; then + continue fi + + ( + cd "$(realpath "$SCRIPT_DIR/$(dirname "$pattern")")" + resolved=$(curl -s --write-out '%{redirect_url}' "$url" | tail -n1) + curl --remote-name --remote-header-name --location "$resolved" + ) + done }