common/scripts/download-release

33 lines
567 B
Plaintext
Raw Permalink Normal View History

2023-07-09 00:39:36 +00:00
#!/bin/bash
BASE=$1
BUILD=$2
DIR=$3
set -euo pipefail
if [ -z "$DIR" ]; then
echo run with $0 NAME BUILD_NUMBER DIR
exit 2
fi
mkdir -p $DIR
BASE=https://geodns.bitnames.com/${BASE}/builds/${BUILD}
files=`curl -sSf ${BASE}/checksums.txt | awk '{print $2}'`
metafiles="checksums.txt metadata.json CHANGELOG.md artifacts.json"
for f in $metafiles; do
url=$BASE/$f
echo downloading $url
curl --remove-on-error -sSfRo $DIR/$f $url || true
done
for f in $files; do
url=$BASE/$f
echo downloading $url
curl --remove-on-error -sSfRo $DIR/$f $url
done