Skip to content

Commit 2eac9ac

Browse files
authored
CircleCI: Actually retry curl (capture error) (#772)
1 parent ec45612 commit 2eac9ac

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

.circleci/config.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,21 @@ jobs:
8888
mkdir -p .circleci && cd .circleci
8989
fetched=false
9090
for i in $(seq 1 6); do
91-
res=$(curl -fsS https://api.github.com/repos/arangodb/docs-hugo/contents/.circleci?ref=$CIRCLE_SHA1)
92-
status=$?
93-
if [[ "$status" -eq 0 ]]; then
94-
urls=$(echo "$res" | jq ".[].download_url")
95-
status=$?
96-
if [[ "$status" -eq 0 ]]; then
91+
echo ""
92+
res=$(curl -fsS https://api.github.com/repos/arangodb/docs-hugo/contents/.circleci?ref=$CIRCLE_SHA1) || curlStatus=$?
93+
if [[ -z "${curlStatus:-}" ]]; then
94+
urls=$(echo "$res" | jq ".[].download_url") || jqStatus=$?
95+
if [[ -z "${jqStatus:-}" ]]; then
9796
fetched=true
9897
break
9998
fi
99+
echo "jq failed with $jqStatus, input:"
100+
echo "$res"
101+
else
102+
echo "curl failed with $curlStatus"
100103
fi
101-
echo "$res"
104+
unset curlStatus
105+
unset jqStatus
102106
sleep 10
103107
done
104108
if [[ "$fetched" = false ]]; then

0 commit comments

Comments
 (0)