Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
b917759865 |
1 changed files with 15 additions and 4 deletions
|
|
@ -162,12 +162,23 @@ steps:
|
||||||
- ip link set dev eth0 mtu 1280 2>/dev/null || true
|
- ip link set dev eth0 mtu 1280 2>/dev/null || true
|
||||||
- for i in 1 2 3 4 5; do apk add -q --no-cache curl && break; sleep 5; done
|
- for i in 1 2 3 4 5; do apk add -q --no-cache curl && break; sleep 5; done
|
||||||
- |
|
- |
|
||||||
LISTING=$(curl -s "https://s3.eu-central-003.backblazeb2.com/devxy-r-builds?prefix=${PLATFORM_ID}/" | \
|
# Backblaze B2's list-bucket API requires authentication, but the upload
|
||||||
grep -oE '<Key>[^<]+</Key>' | sed 's/<[^>]*>//g')
|
# credentials are scoped to the plugin-s3 image and aren't available here.
|
||||||
|
# Individual objects are public-read, so probe each expected artifact URL
|
||||||
|
# with an anonymous HEAD instead of listing the bucket. The filename mirrors
|
||||||
|
# what nfpm produces in builder/package.${PLATFORM} (version/release pinned
|
||||||
|
# to 1): r-<ver>_1_<arch>.{apk,deb} for alpine/ubuntu, R-<ver>-1-1.<arch>.rpm
|
||||||
|
# for el*.
|
||||||
|
case "${PLATFORM}" in
|
||||||
|
alpine-*) FILE="r-VER_1_${ARCH_ID}.apk" ;;
|
||||||
|
ubuntu-*) FILE="r-VER_1_${ARCH_ID}.deb" ;;
|
||||||
|
*) FILE="R-VER-1-1.${ARCH_ID}.rpm" ;;
|
||||||
|
esac
|
||||||
|
BASE="https://s3.eu-central-003.backblazeb2.com/devxy-r-builds/${PLATFORM_ID}"
|
||||||
: > r-versions-existing.txt
|
: > r-versions-existing.txt
|
||||||
for VERSION in $(cat r-versions-to-build.txt); do
|
for VERSION in $(cat r-versions-to-build.txt); do
|
||||||
if printf '%s\n' "$LISTING" | \
|
URL="${BASE}/$(echo "$FILE" | sed "s/VER/${VERSION}/")"
|
||||||
awk -v arch="${ARCH_ID}" -v ver="$VERSION" 'index($0, arch) && index($0, ver) { found=1 } END { exit !found }'; then
|
if [ "$(curl -s -o /dev/null -w '%{http_code}' -I "$URL")" = "200" ]; then
|
||||||
echo "$VERSION" >> r-versions-existing.txt
|
echo "$VERSION" >> r-versions-existing.txt
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue