prune: don't abort when a distro has no versioned tags
Build containers / Compute changes (push) Successful in 3s
Build containers / fedora-cosmic (rawhide) (push) Failing after 58s
Build containers / fedora-remote (44) (push) Successful in 10m43s
Build containers / fedora-cosmic (44) (push) Successful in 13m20s
Build containers / Prune old releases and tags (push) Successful in 27s
Build containers / Compute changes (push) Successful in 3s
Build containers / fedora-cosmic (rawhide) (push) Failing after 58s
Build containers / fedora-remote (44) (push) Successful in 10m43s
Build containers / fedora-cosmic (44) (push) Successful in 13m20s
Build containers / Prune old releases and tags (push) Successful in 27s
fedora-remote has no rawhide.* tags yet, so grep exited non-zero and, under set -e/pipefail, killed prune-registry.sh before it reported anything. Tolerate an empty match.
This commit is contained in:
+3
-1
@@ -37,8 +37,10 @@ done
|
||||
declare -A keep=()
|
||||
for d in "${DISTROS[@]}"; do
|
||||
keep["${d}"]=1
|
||||
# A distro that has no versioned tags yet is fine; don't let grep's non-zero
|
||||
# exit status abort the script under set -e/pipefail.
|
||||
newest="$(grep -E "^${d}\.[0-9]+\.[0-9]+$" <<< "${versions}" \
|
||||
| sort -t. -k2,2n -k3,3n | tail -1)"
|
||||
| sort -t. -k2,2n -k3,3n | tail -1 || true)"
|
||||
[[ -n "${newest}" ]] && keep["${newest}"]=1
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user