# Delete a retired slot's objects from the bucket. # # The config half of a retirement (`.crow/*.yaml` matrices) is a commit, so it # happens on a workstation: # # Rscript local/retire-slot.R --config-only --apply # # The asset half needs the B2 credentials, which only exist in CI, so it # happens here. `local/retire-slot.R` refuses any slot still listed in # `local.rpkgs_slots` in cdn.tf, so this pipeline cannot delete a live slot # however it is invoked. # # Dry run unless RETIRE_APPLY is 'yes'. The dry run reports the object count, # which is the number worth looking at before deleting a five-figure prefix. # # crow pipeline create devxy/build-cran-binaries --branch main \ # --var retire_slot=alpine322 --var RETIRE_APPLY=yes # # Retiring a distro retires both architectures: `local.rpkgs_slots` is a # setproduct over both, so there is no way to publish one without the other, # and the script deletes `amd64//` and `arm64//` together. # # The slot's cron jobs are not in this repository and are not removed here. The # script prints them by name, with the API call, at the end of the run. 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