From 1ceed46b7f7ee23149ad08bd148e5689d7659c9b Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Tue, 26 Sep 2023 14:50:44 +0200 Subject: [PATCH] tools/sign-installer.sh: Add retry loop We currently have CI issues with signing the installer. The signing step fails very often with: Run tools/sign-installer.sh -p "***" Done Adding Additional Store Number of errors: 1 SignTool Error: The file is being used by another process. SignTool Error: An error occurred while attempting to sign: tools/installer/MIES-Release_2.7_20230809-85-g2be12df50-cis.exe The causes are unknown. As a band-aid let's retry the signing step on error. --- tools/sign-installer.sh | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/tools/sign-installer.sh b/tools/sign-installer.sh index bda5f4d654..9081caeaf8 100755 --- a/tools/sign-installer.sh +++ b/tools/sign-installer.sh @@ -65,12 +65,27 @@ done # signtool does not accept a path for the certificate cp $top_level/tools/installer/public-key.cer public-key.cer -MSYS_NO_PATHCONV=1 "$sign_tool_exe" sign \ - /tr http://timestamp.sectigo.com \ - /fd sha256 \ - /td sha256 \ - /csp "eToken Base Cryptographic Provider" \ - /kc "$privKeyContainerName" \ - /f public-key.cer \ - tools/installer/MIES*.exe \ - || exit $? +i=0 + +while [ $i -le 10 ] +do + MSYS_NO_PATHCONV=1 "$sign_tool_exe" sign \ + /tr http://timestamp.sectigo.com \ + /fd sha256 \ + /td sha256 \ + /csp "eToken Base Cryptographic Provider" \ + /kc "$privKeyContainerName" \ + /f public-key.cer \ + tools/installer/MIES*.exe + + if [ $? -eq 0 ] + then + exit 0 + fi + + ((i++)) + + sleep $i +done + +exit 1