CI: if all 3 attempts of upload failed, exit with status code '1'

This commit is contained in:
Leonid Pliushch 2019-07-22 18:39:16 +03:00
parent 1b8104e0a9
commit c4f308fae3

View File

@ -106,13 +106,18 @@ if ! $DO_UPLOAD; then
./build-package.sh -a "$TERMUX_ARCH" -I $PACKAGE_NAMES
else
for _ in 1 2 3; do
for attempt in 1 2 3; do
echo "[*] Uploading packages to Bintray:"
if ./scripts/package_uploader.sh -p "${PWD}/debs" $PACKAGE_NAMES; then
break
else
echo "[!] Failure, retrying in 30 seconds..."
sleep 30
if [ "$attempt" = "3" ]; then
echo "[!] Went through 3 attempts of upload, giving up..."
exit 1
else
echo "[!] Failure, retrying in 30 seconds..."
sleep 30
fi
fi
done
fi