ci: persist NuGet restore cache across Linux builds [CI]
ci/woodpecker/push/web-build Pipeline was successful
ci/woodpecker/push/verify Pipeline failed
ci/woodpecker/push/dev-image Pipeline failed

This commit is contained in:
justme committed 2026-10-21 13:50:43 +08:00
1 parent f2af7950e7
commit 59c98e6d7b
6 files changed
+34 -25

No files matched your search

+2 -2
View File
@@ -1,12 +1,12 @@
#!/usr/bin/env bash
# Caller holds its store lock. Keep recent image layers and persistent RUN caches.
# Caller holds its store lock. Keep recent image layers and the host NuGet cache.
set -euo pipefail
: "${CONTAINERS_STORAGE_CONF:?an explicit, locked CI Buildah store is required}"
# No build is active while the caller holds the exclusive store lock. Remove
# working containers left by canceled builds before considering old image layers.
buildah unshare buildah rm --all >/dev/null 2>&1 || true
buildah rmi localhost/moshiro-agent-binaries:linux-musl-x64 >/dev/null 2>&1 || true
# prune also deletes RUN cache mounts; remove only expired intermediate layers and versioned application images.
# Remove only expired intermediate layers and versioned application images.
mapfile -t expired < <(buildah images --all --no-trunc --format '{{.ID}} {{.Created}} {{.Name}}:{{.Tag}}' | python3 -c '
import re,sys,time
cutoff=time.time()-7*86400