github_packages: additional retry of skopeo copy with backoff
This commit is contained in:
parent
58f7cb0d4e
commit
de98ad53cc
@ -412,7 +412,16 @@ class GitHubPackages
|
||||
puts "#{skopeo} #{args.join(" ")} --dest-creds=#{user}:$HOMEBREW_GITHUB_PACKAGES_TOKEN"
|
||||
else
|
||||
args << "--dest-creds=#{user}:#{token}"
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user