OPS: Retry upload to TF lane 3 times (#5886)

This commit is contained in:
Marcos Rodriguez Vélez 2023-12-06 18:13:57 -04:00 committed by GitHub
parent 830a653051
commit 1b3177a5e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -105,6 +105,9 @@ platform :ios do
desc "Upload to TestFlight"
lane :upload_to_testflight_lane do
attempts = 0
max_attempts = 3
begin
UI.message("Uploading to TestFlight...")
changelog = ENV["LATEST_COMMIT_MESSAGE"]
@ -114,6 +117,18 @@ platform :ios do
skip_waiting_for_build_processing: true,
changelog: changelog
)
rescue => exception
attempts += 1
if attempts < max_attempts
wait_time = 60 # Time in seconds
UI.message("Attempt ##{attempts} failed, waiting #{wait_time} seconds before trying again...")
sleep(wait_time)
retry
else
UI.error("Failed after #{max_attempts} attempts. Error: #{exception.message}")
raise exception
end
end
end
desc "Deploy to TestFlight"