fix(ci): honour FORCE_REBUILD from both manual trigger forms #11

Merged
pat-s merged 1 commit from fix/force-rebuild-both-trigger-forms into main 2026-09-18 07:14:24 +00:00
Showing only changes of commit 37f2315f9b - Show all commits

fix(ci): honour FORCE_REBUILD from both manual trigger forms

The escape hatch added in #9 only read a bare $FORCE_REBUILD, which covers
`crow pipeline start -p FORCE_REBUILD=1`, where the parameter is injected
into the step environment. It does not cover
`crow pipeline create --branch main --var FORCE_REBUILD=1`, which passes a
crow substitution variable instead.

Triggering a fresh run of main is a `create`, so the flag would have been
silently ignored in exactly the case it is needed, and the run would skip
every Alpine version it was meant to rebuild.

Read the substituted ${FORCE_REBUILD} into FORCE_REBUILD_VAR and accept
either source. Crow blanks an unsupplied substitution variable rather than
failing, as recorded in 8eacc0a, so a plain cron run still takes the dedup
path.
Patrick Schratz 2026-09-18 09:08:54 +02:00
No known key found for this signature in database
GPG key ID: 62050D5BC68AB6DC

View file

@ -181,10 +181,18 @@ steps:
# Escape hatch for when the builder image itself changes in a way that
# alters the resulting R binary (a newly enabled graphics device, a
# different BLAS). The artifact filename carries only the R version, so
# dedup would otherwise keep the stale binaries forever. Set FORCE_REBUILD
# to a non-empty value as a pipeline variable on a manual run, or hardcode
# it here temporarily; uploads overwrite in place.
if [ -n "$FORCE_REBUILD" ]; then
# dedup would otherwise keep the stale binaries forever. Uploads
# overwrite in place.
#
# The two ways to trigger a manual run pass the flag differently:
# crow pipeline create --branch main --var FORCE_REBUILD=1
# -> a crow substitution variable, read below as ${FORCE_REBUILD},
# which crow blanks out when it was not supplied
# crow pipeline start -p FORCE_REBUILD=1
# -> injected into the step environment, read as bare $FORCE_REBUILD
# Accept either, so the flag cannot be silently ignored.
FORCE_REBUILD_VAR="${FORCE_REBUILD}"
if [ -n "$FORCE_REBUILD_VAR" ] || [ -n "$FORCE_REBUILD" ]; then
echo "FORCE_REBUILD is set, ignoring artifacts already in the bucket"
else
for VERSION in $(cat r-versions-to-build.txt); do