fix(ci): pass the metadata DB to per-minor reindexes and fail on errors
- Pass `metadata_db_*` explicitly to every per-minor `upload_package_index()` call, so bincraft can drop its implicit production defaults (rpkgs/bincraft#211). - Replace `|| true` in the per-minor reindex loops with a failure list, so every minor is still attempted but a failed reindex fails the step. - Give the "Upload package indexes" step of build-all-versions the `PGPASS` secret, without which its per-minor reindexes always aborted. - Run the CDN purge in process-updates and prune-stale-flat-binaries even when a reindex failed, as reindex.yaml already does. - Fail local/repair-built-stamp.R when a per-minor reindex fails instead of only printing the error.
This commit is contained in:
parent
a310790ad8
commit
8a7942d7d7
1 changed files with 79 additions and 16 deletions
|
|
@ -209,10 +209,15 @@ steps:
|
|||
exit 0
|
||||
fi
|
||||
/opt/R/4.5.3/bin/R -q -e 'library(bincraft); upload_package_index(s3_endpoint = "https://s3.eu-central-003.backblazeb2.com", s3_region = "eu-central-003", s3_bucket = "devxy-rpkgs-binaries", s3_access_key_id = Sys.getenv("B2_S3_ACCESS_KEY"), s3_secret_access_key = Sys.getenv("B2_S3_SECRET_KEY"))'
|
||||
FAILED_MINORS=""
|
||||
for RBIN in /opt/R/[0-9]*/bin/R; do
|
||||
RMINOR=$(basename "$(dirname "$(dirname "$RBIN")")" | cut -d. -f1-2)
|
||||
/opt/R/4.5.3/bin/R -q -e "library(bincraft); upload_package_index(r_minor = '$RMINOR', s3_endpoint = 'https://s3.eu-central-003.backblazeb2.com', s3_region = 'eu-central-003', s3_bucket = 'devxy-rpkgs-binaries', s3_access_key_id = Sys.getenv('B2_S3_ACCESS_KEY'), s3_secret_access_key = Sys.getenv('B2_S3_SECRET_KEY'))" || true
|
||||
/opt/R/4.5.3/bin/R -q -e "library(bincraft); upload_package_index(r_minor = '$RMINOR', s3_endpoint = 'https://s3.eu-central-003.backblazeb2.com', s3_region = 'eu-central-003', s3_bucket = 'devxy-rpkgs-binaries', s3_access_key_id = Sys.getenv('B2_S3_ACCESS_KEY'), s3_secret_access_key = Sys.getenv('B2_S3_SECRET_KEY'), metadata_db_host = 'r-binaries.devxy.io', metadata_db_name = 'build_metadata', metadata_db_port = 15432L, metadata_db_user = 'rpkgs', metadata_db_password = Sys.getenv('PGPASS'), metadata_db_sslmode = 'require')" || FAILED_MINORS="$FAILED_MINORS $RMINOR"
|
||||
done
|
||||
if [ -n "$FAILED_MINORS" ]; then
|
||||
echo "Could not republish the per-minor index for:$FAILED_MINORS" >&2
|
||||
exit 1
|
||||
fi
|
||||
backend_options:
|
||||
docker:
|
||||
resources:
|
||||
|
|
@ -240,3 +245,7 @@ steps:
|
|||
fi
|
||||
apk add --no-cache -q bash curl jq
|
||||
bash scripts/purge_cdn_zone.sh "$BUNNYNET_API_KEY" $BUNNY_PULLZONES
|
||||
# Run it even when a per-minor re-index above failed: the generic index
|
||||
# and the objects were still replaced, and a stale edge keeps them hidden.
|
||||
when:
|
||||
- status: [success, failure]
|
||||
|
|
|
|||
Loading…
Reference in a new issue