[openssh-commits] [openssh] 01/01: Retry package installation 3 times.

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Jan 13 23:08:33 AEDT 2023


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit d03e245e034019a37388f6f5f893ce848ab6d2e2
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Fri Jan 13 23:02:34 2023 +1100

    Retry package installation 3 times.
    
    When setting up the CI environment, retry package installation 3 times
    before going up.  Should help prevent spurious failures during
    infrastructure issues.
---
 .github/setup_ci.sh | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/.github/setup_ci.sh b/.github/setup_ci.sh
index 044c4d12..e4480e61 100755
--- a/.github/setup_ci.sh
+++ b/.github/setup_ci.sh
@@ -139,16 +139,29 @@ if [ "yes" = "$INSTALL_FIDO_PPA" ]; then
     sudo apt-add-repository -y ppa:yubico/stable
 fi
 
-if [ "x" != "x$PACKAGES" ]; then
+tries=3
+while [ ! -z "$PACKAGES" ] && [ "$tries" -gt "0" ]; do
     case "$PACKAGER" in
     apt)
 	sudo apt update -qq
-	sudo apt install -qy $PACKAGES
+	if sudo apt install -qy $PACKAGES; then
+		PACKAGES=""
+	fi
 	;;
     setup)
-	/cygdrive/c/setup.exe -q -P `echo "$PACKAGES" | tr ' ' ,`
+	if /cygdrive/c/setup.exe -q -P `echo "$PACKAGES" | tr ' ' ,`; then
+		PACKAGES=""
+	fi
 	;;
     esac
+    if [ ! -z "$PACKAGES" ]; then
+	sleep 90
+    fi
+    tries=$(($tries - 1))
+done
+if [ ! -z "$PACKAGES" ]; then
+	echo "Package installation failed."
+	exit 1
 fi
 
 if [ "${INSTALL_HARDENED_MALLOC}" = "yes" ]; then

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list