Skip to content

Commit

Permalink
test: add auto-download of stemcells for local test
Browse files Browse the repository at this point in the history
  • Loading branch information
peanball committed Apr 22, 2024
1 parent b29433f commit b4b9ef1
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions acceptance-tests/run-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit b4b9ef1

Please sign in to comment.