Make packagecloud_upload.sh resilient to failures in packagecloud
As seen in this build log, the packagecloud client can actually fail randomly. Currently, we're not attributing this as a failure. We should create more resiliency in calling script so that we're capable of either retrying or graceful failure depending on the result. Never forget Murphy.
bash support/packagecloud_upload.sh gitlab gitlab-ce el/7
Uploading 'pkg/centos-7.2.1511/gitlab-ce-8.14.1-ce.0.el7.x86_64.rpm' to packagecloud at 'gitlab/gitlab-ce/el/7'
/builds/gitlab/omnibus-gitlab/gems/ruby/2.1.0/gems/rest-client-1.6.9/lib/restclient/abstract_response.rb:48:in `return!': 504 Gateway Timeout (RestClient::GatewayTimeout)
Suggestion:
- Turn the call to
package_cloud
into a function, which handles detection of retry/fail conditions - Have the loop & script exit with the exit code, if true failure occurs.