mirror of
https://gitlab.archlinux.org/archlinux/archlinux-docker.git
synced 2025-12-27 21:11:04 +01:00
Merge branch 'package-registry-cleanup' into 'master'
Remove the rootfses from the package registry after 60 days Closes #57 See merge request archlinux/archlinux-docker!57
This commit is contained in:
commit
293bcb10aa
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user