Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github_packages: additional retry of skopeo copy with backoff #14932

Merged
merged 2 commits into from Mar 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion Library/Homebrew/github_packages.rb
Expand Up @@ -412,7 +412,16 @@ def upload_bottle(user, token, skopeo, formula_full_name, bottle_hash, keep_old:
puts "#{skopeo} #{args.join(" ")} --dest-creds=#{user}:$HOMEBREW_GITHUB_PACKAGES_TOKEN"
else
args << "--dest-creds=#{user}:#{token}"
system_command!(skopeo, verbose: true, print_stdout: true, args: args)
retry_count = 0
begin
system_command!(skopeo, verbose: true, print_stdout: true, args: args)
rescue ErrorDuringExecution
retry_count += 1
odie "Cannot perform an upload to registry after retrying multiple times!" if retry_count >= 5
sleep 5*retry_count
retry
end

package_name = "#{GitHubPackages.repo_without_prefix(repo)}/#{image_name}"
ohai "Uploaded to https://github.com/orgs/#{org}/packages/container/package/#{package_name}"
end
Expand Down