build-cran-binaries/.crow/retire-slot.yaml
pat-s cc9d7b6046
refactor(slots): cut the comments down to the essentials
Addresses review on #214.

This change will:

- Trim the header comments of `local/check-slots.R`, `local/retire-slot.R` and
  `.crow/retire-slot.yaml` to what a reader needs, dropping the narrative about
  how Alpine 3.22 got into that state.
- Reduce the README section to the ordered steps and the two constraints that
  matter.

Behaviour is unchanged: against the tree at 523424b the script still reproduces
#213's structural changes, differing only in the same prose-only file, and both
guards still fire.
2026-09-11 08:21:23 +00:00

72 lines
2.2 KiB
YAML

# Delete a retired slot's objects from the bucket.
#
# The config half is a commit, so it runs on a workstation:
# just retire-slot <codename> --apply
#
# This half needs the B2 credentials, which only exist in CI.
# `local/retire-slot.R` refuses any slot still listed in `local.rpkgs_slots`,
# so this cannot delete a live slot. Both architectures go together.
#
# Dry run unless RETIRE_APPLY is 'yes':
#
# crow pipeline create devxy/build-cran-binaries --branch main \
# --var retire_slot=alpine322 --var RETIRE_APPLY=yes
variables:
# A manual pipeline creation instantiates every file in .crow/, so the
# default must be a value the script never accepts.
retire_slot:
description: "Codename of the slot to retire (e.g. alpine322), or 'none'."
default: none
RETIRE_APPLY:
description: "Set to 'yes' to delete. Anything else reports and changes nothing."
options:
- 'no'
- 'yes'
default: 'no'
when:
- event: manual
evaluate: 'retire_slot != "none"'
skip_clone: true
labels:
group: rpkgs-amd64
steps:
- name: 'Delete the retired slot from the bucket'
image: reg.devxy.io/rpkgs/build-env-alpine:3.24
pull: true
environment:
OTEL_R_TRACES_EXPORTER: none
OTEL_R_LOGS_EXPORTER: none
OTEL_R_METRICS_EXPORTER: none
B2_S3_ACCESS_KEY:
from_secret: B2_S3_ACCESS_KEY
B2_S3_SECRET_KEY:
from_secret: B2_S3_SECRET_KEY
REPO_RO_TOKEN:
from_secret: REPO_RO_TOKEN
R_LIBS_USER: /tmp/R-pkgs
# Pipeline variables are substituted into the YAML, not exported, so they
# have to be bound here to be readable as env vars in the script below.
RETIRE_SLOT: ${retire_slot}
RETIRE_APPLY: ${RETIRE_APPLY}
commands:
- git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git .
- mkdir -p /tmp/R-pkgs
- /opt/R/4.5.3/bin/Rscript local/install-bincraft.R
- |
set -eu
APPLY=""
if [ "$$RETIRE_APPLY" = "yes" ]; then
APPLY="--apply"
fi
/opt/R/4.5.3/bin/Rscript local/retire-slot.R "$$RETIRE_SLOT" --assets-only $$APPLY
backend_options:
docker:
resources:
requests:
memory: 2Gi
cpu: 1000m