fix(ci): use bare shell vars in existing-version check (crow ${VAR} substitution)
All checks were successful
ci/crow/cron/build/6 Pipeline was successful
ci/crow/cron/build/10 Pipeline was successful
ci/crow/cron/build/16 Pipeline was successful
ci/crow/cron/build/8 Pipeline was successful
ci/crow/cron/build/5 Pipeline was successful
ci/crow/cron/build/18 Pipeline was successful
ci/crow/cron/build/14 Pipeline was successful
ci/crow/cron/build/17 Pipeline was successful
ci/crow/cron/build/9 Pipeline was successful
ci/crow/cron/build/13 Pipeline was successful
ci/crow/cron/build/4 Pipeline was successful
ci/crow/cron/build/15 Pipeline was successful
ci/crow/cron/build/7 Pipeline was successful
ci/crow/cron/build/3 Pipeline was successful
ci/crow/cron/build/2 Pipeline was successful
ci/crow/cron/build/12 Pipeline was successful
ci/crow/cron/build/11 Pipeline was successful
ci/crow/cron/build/1 Pipeline was successful
All checks were successful
ci/crow/cron/build/6 Pipeline was successful
ci/crow/cron/build/10 Pipeline was successful
ci/crow/cron/build/16 Pipeline was successful
ci/crow/cron/build/8 Pipeline was successful
ci/crow/cron/build/5 Pipeline was successful
ci/crow/cron/build/18 Pipeline was successful
ci/crow/cron/build/14 Pipeline was successful
ci/crow/cron/build/17 Pipeline was successful
ci/crow/cron/build/9 Pipeline was successful
ci/crow/cron/build/13 Pipeline was successful
ci/crow/cron/build/4 Pipeline was successful
ci/crow/cron/build/15 Pipeline was successful
ci/crow/cron/build/7 Pipeline was successful
ci/crow/cron/build/3 Pipeline was successful
ci/crow/cron/build/2 Pipeline was successful
ci/crow/cron/build/12 Pipeline was successful
ci/crow/cron/build/11 Pipeline was successful
ci/crow/cron/build/1 Pipeline was successful
The merged HEAD-probe check still rebuilt everything: crow runs its own
${VAR} substitution over the commands before the shell executes, so the
shell variables ${BASE} and ${VERSION} were blanked to empty (only matrix
vars resolve at that stage). Every probed URL was therefore malformed and
returned non-200, leaving r-versions-existing.txt empty.
Use bare $name for shell variables and build the filename with printf, which
avoids the ${VERSION}_1 brace requirement entirely. Matrix vars (${PLATFORM},
${PLATFORM_ID}, ${ARCH_ID}) keep braces since crow resolves those correctly.
Verified URL construction against the live bucket for apk, deb and rpm.
This commit is contained in:
parent
ca336c2720
commit
8eacc0ab47
1 changed files with 7 additions and 5 deletions
|
|
@ -168,16 +168,18 @@ steps:
|
|||
# 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*.
|
||||
# for el*. Shell variables must use bare $name, not ${name}: crow performs
|
||||
# its own ${VAR} substitution on these commands before the shell runs, so
|
||||
# ${VAR} for a shell var would be blanked out (only matrix vars resolve there).
|
||||
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" ;;
|
||||
alpine-*) FMT="r-%s_1_%s.apk" ;;
|
||||
ubuntu-*) FMT="r-%s_1_%s.deb" ;;
|
||||
*) FMT="R-%s-1-1.%s.rpm" ;;
|
||||
esac
|
||||
BASE="https://s3.eu-central-003.backblazeb2.com/devxy-r-builds/${PLATFORM_ID}"
|
||||
: > r-versions-existing.txt
|
||||
for VERSION in $(cat r-versions-to-build.txt); do
|
||||
URL="${BASE}/$(echo "$FILE" | sed "s/VER/${VERSION}/")"
|
||||
URL="$BASE/$(printf "$FMT" "$VERSION" "${ARCH_ID}")"
|
||||
if [ "$(curl -s -o /dev/null -w '%{http_code}' -I "$URL")" = "200" ]; then
|
||||
echo "$VERSION" >> r-versions-existing.txt
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue