From 5641d88e16c0040756d0e54c34d8768270ec5f68 Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Thu, 21 Aug 2025 12:45:59 +0200 Subject: [PATCH] CircleCI: Actually retry curl (capture error) --- .circleci/config.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5e2c9c805e..e8886cd9b5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -88,17 +88,21 @@ jobs: mkdir -p .circleci && cd .circleci fetched=false for i in $(seq 1 6); do - res=$(curl -fsS https://api.github.com/repos/arangodb/docs-hugo/contents/.circleci?ref=$CIRCLE_SHA1) - status=$? - if [[ "$status" -eq 0 ]]; then - urls=$(echo "$res" | jq ".[].download_url") - status=$? - if [[ "$status" -eq 0 ]]; then + echo "" + res=$(curl -fsS https://api.github.com/repos/arangodb/docs-hugo/contents/.circleci?ref=$CIRCLE_SHA1) || curlStatus=$? + if [[ -z "${curlStatus:-}" ]]; then + urls=$(echo "$res" | jq ".[].download_url") || jqStatus=$? + if [[ -z "${jqStatus:-}" ]]; then fetched=true break fi + echo "jq failed with $jqStatus, input:" + echo "$res" + else + echo "curl failed with $curlStatus" fi - echo "$res" + unset curlStatus + unset jqStatus sleep 10 done if [[ "$fetched" = false ]]; then