From: David Galloway Date: Thu, 12 Mar 2026 22:44:35 +0000 (-0400) Subject: sync-pull: Check the actual repo readiness X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6b77bd036cfa86a2e902eadb3eb89d3ebc52d0ff;p=ceph-build.git sync-pull: Check the actual repo readiness This has been broken for.. possibly ever. --head results in 405 Method Not Allowed Just a GET results in 200 no matter what, whether the repo exists or not. ``` ++ curl -fsSo - --connect-timeout 5 --max-time 10 https://shaman.ceph.com/api/repos/ceph/reef/efac5a54607c13fa50d4822e50242b86e6e446df/rocky/10/flavors/default/ ++ jq -r '.[].status // empty' + status= + '[' '' = ready ']' + echo 'Shaman repo for rocky/10 is not ready (status: unknown). Skipping.' Shaman repo for rocky/10 is not ready (status: unknown). Skipping. ``` Signed-off-by: David Galloway --- diff --git a/scripts/sync-pull b/scripts/sync-pull index c805cea4..42ffe22a 100755 --- a/scripts/sync-pull +++ b/scripts/sync-pull @@ -70,12 +70,16 @@ fi for el_version in centos/9 rocky/10; do echo "--------------------------------------------" - if curl -fs --head --connect-timeout 5 --max-time 10 https://shaman.ceph.com/api/repos/$project/$release/$sha1/$el_version/flavors/default/ >/dev/null 2>&1; then + + # "//" in jq land is OR. "empty" is a jq magic variable that returns nothing. + status=$(curl -fsSo - --connect-timeout 5 --max-time 10 "https://shaman.ceph.com/api/repos/$project/$release/$sha1/$el_version/flavors/default/" | jq -r '.[].status // empty') + + if [ "$status" = "ready" ]; then el_cmd="ubuntu@chacra.ceph.com:/opt/repos/$project/$release/$sha1/$el_version/flavors/default/* /opt/repos/$project/$relver/$el_version/" - echo $el_cmd + echo "$el_cmd" rsync -Lavh --progress $el_cmd else - echo "Shaman thinks a repo for $el_version doesn't exist. Skipping." + echo "Shaman repo for $el_version is not ready (status: ${status:-unknown}). Skipping." fi done