[GHA] correct wait times

This commit is contained in:
aboyko
2024-11-06 23:17:19 -05:00
parent f563a9157a
commit 22dc128022
2 changed files with 5 additions and 6 deletions

View File

@@ -18,7 +18,7 @@ echo "Successfully extracted ${filename}"
sts_folder=`find ./${destination_folder_name} -maxdepth 1 -type d -name 'sts-*' -print -quit`
echo "Found STS distro folder: ${sts_folder}"
echo "About to sign win exe file: ${sts_folder}/SpringToolSuite4.exe (id = ${id})"
$sign_script ${sts_folder}/SpringToolSuite4.exe ${sts_folder}/SpringToolSuite4.exe "${id}-${filename%.*}" 30 30
$sign_script ${sts_folder}/SpringToolSuite4.exe ${sts_folder}/SpringToolSuite4.exe "${id}-${filename%.*}" 30 900
echo "Adding to zip contents of a folder ${destination_folder_name}"
cd ${destination_folder_name}
zip -r -q ../$file .

View File

@@ -3,21 +3,20 @@ in_file=$1
out_file=$2
id=$3
wait_time=$4
number_of_sleeps=$5
timeout=$5
in_filename="$(basename -- $in_file)"
echo "Copying ${in_file} to s3 s3://${AWS_S3_BUCKET}/exes-to-sign/${id}.exe for signing"
aws s3 cp $in_file s3://$AWS_S3_BUCKET/exes-to-sign/$id.exe
for i in {1..$number_of_sleeps}
do
for (( i=wait_time; i<timeout; i+=wait_time )) ; {
sleep $wait_time
aws s3api head-object --bucket $CDN_BUCKET --key spring-tools/exes-signed/$id.exe || NOT_EXIST=true
if [ $NOT_EXIST ]; then
echo "Waited ${wait_time} seconds but ${in_filename} hasn't been signed yet..."
echo "Waited ${i} seconds but ${in_filename} hasn't been signed yet..."
else
echo "Successfully signed file ${in_filename}"
break
fi
done
}
aws mv s3://$AWS_S3_BUCKET/exes-signed/$id.exe $out_file