Commit e7423002 authored by Kristian Klausen's avatar Kristian Klausen 🎉
Browse files

Remove the rootfses from the package registry after 60 days

According to upstream two months is fine:
tianon: yeah, cleaning them out is reasonable, although I'd request that
they be available for something like 1-2 months after they're no longer
supported / "active"
tianon: in the case of something constantly changing like arch, 1 month
is probably pretty reasonable

Fix #57
parent cce3f61a
......@@ -2,6 +2,7 @@ default:
image: "archlinux:latest"
stages:
- cleanup
- lint
- rootfs
- image
......@@ -9,6 +10,23 @@ stages:
- release
- publish
cleanup:
stage: cleanup
tags:
- secure
only:
refs:
- schedules
variables:
- $CLEANUP_PACKAGE_REGISTRY == "TRUE"
before_script:
- pacman -Syu --noconfirm jq
script:
- |
for id in $(curl --silent --fail --show-error "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages?per_page=100&order_by=created_at&sort=asc" | jq '.[] | select(.created_at | split("T")[0] | . < (now-60*60*24*60|strflocaltime("%Y-%m-%d"))) | .id'); do
curl --silent --fail --show-error --request DELETE --header "PRIVATE-TOKEN: ${GITLAB_PROJECT_TOKEN}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/${id}"
done
lint:
stage: lint
image: hadolint/hadolint:latest-alpine
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment