[GHA] fix broken wait. Sign multiple win exes in parallel

This commit is contained in:
aboyko
2024-11-07 09:43:51 -05:00
parent b36fd3e931
commit 8dc883ceac
2 changed files with 16 additions and 3 deletions

View File

@@ -10,13 +10,14 @@ echo "Copying ${in_file} to s3 s3://${AWS_S3_BUCKET}/exes-to-sign/${id}.exe for
aws s3 cp $in_file s3://$AWS_S3_BUCKET/exes-to-sign/$id.exe --no-progress
for (( i=wait_time; i<timeout; i+=wait_time )) ; {
sleep $wait_time
object_exists=$(aws s3api head-object --bucket $CDN_BUCKET --key spring-tools/exes-signed/$id.exe > /dev/null 2>&1 || true)
if [ -z "$object_exists" ]; then
aws s3api head-object --bucket $CDN_BUCKET --key spring-tools/exes-signed/$id.exe >/dev/null 2>&1 || not_exist=true
if [ $not_exist ]; then
echo "Waited ${i} seconds but ${in_filename} hasn't been signed yet..."
else
echo "Successfully signed file ${in_filename}"
break
fi
unset not_exist
}
aws s3 mv s3://$AWS_S3_BUCKET/exes-signed/$id.exe $out_file --no-progress