Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: return correct exit code after retrying #6640

Merged
merged 4 commits into from
Aug 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .circleci/retry-yarn-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ done

# initialize counter
n=0
# loop until n >= first param
until [ "$n" -ge $N ]
# loop until n > first param
until [ "$n" -gt $N ]
do
# $1 is the argument passed in, e.g. publish:verdaccio
# if the publish command succeeds, `break` exits the loop
Expand All @@ -34,10 +34,18 @@ do
echo "Resetting git HEAD"
git reset --hard
fi


if [ "$n" -eq $N ];
then
echo "Returning error"
exit 1
fi

# increment counter
n=$((n+1))

# wait 5 seconds
sleep 5
echo "Retry $n of $N"
done
done