Skip to content

Commit

Permalink
tools/sign-installer.sh: Add retry loop
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
t-b committed Sep 26, 2023
1 parent 51f74d4 commit 1ceed46
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions tools/sign-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1ceed46

Please sign in to comment.