organization_license_audit 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6424c2da9ef6b8f8c56cf3890e2a0fc3df447f1
4
- data.tar.gz: b9617b179511cb18e310acf49fde716de06ecb1c
3
+ metadata.gz: 1b35157b61295f403ab5fde9070fc04cc6d43189
4
+ data.tar.gz: ce1ee9355f04f87417f78481e818ff44168981cc
5
5
  SHA512:
6
- metadata.gz: 3d970d57025a40304df6989aae0f3f221bb2516cf844465f425946962a7bcdc763e298161cb681157cdee691818f586c6878e58ec117a7835a8ef20ef27696ed
7
- data.tar.gz: dd56bbcaa5f547d3d51ea194e5345ff844cc8e22ad8c6910bbce4d6a171dc694c80fa1337c196834eaecd4990eeab5c87c7ade4bd7b9131cf9f5a788945bc265
6
+ metadata.gz: 55a08621a75fb4be0394bdec8d100cd3de29ba357b5b23a6d080f01ef372091d58a50f56421e53477a915e2f1fe488129d3cd49f39b798c06b82664f6ce6ab2a
7
+ data.tar.gz: 1a0b60c00ba891147ddbaed6db8f29fab5dbfd5aa145fc5d445d80fe0630658108d442616877d69bc4b61439bed220ee31629894ab593563b99ad2561f4e6123
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -2,6 +2,7 @@ require "organization_license_audit/version"
2
2
  require "tmpdir"
3
3
  require "organization_audit"
4
4
  require "shellwords"
5
+ require "open3"
5
6
 
6
7
  module OrganizationLicenseAudit
7
8
  BUNDLE_PATH = "vendor/bundle"
@@ -78,7 +79,13 @@ module OrganizationLicenseAudit
78
79
  end
79
80
 
80
81
  def download_file(repo, file)
81
- return unless content = repo.content(file)
82
+ begin
83
+ content = repo.content(file)
84
+ rescue StandardError => e
85
+ puts "Error downloading #{file}: #{e.to_s}"
86
+ content = repo.content(file)
87
+ end
88
+ return unless content
82
89
  FileUtils.mkdir_p(File.dirname(file))
83
90
  File.write(file, content)
84
91
  end
@@ -172,7 +179,7 @@ module OrganizationLicenseAudit
172
179
  def prepare_bundler(bundle_cache_dir, options)
173
180
  with_or_without :bundler, options do
174
181
  use_cache_dir_to_bundle(bundle_cache_dir)
175
- raise "Failed to bundle" unless sh("bundle --path #{BUNDLE_PATH} --quiet").first
182
+ raise "Failed to bundle" unless sh_with_retry("bundle --path #{BUNDLE_PATH} --quiet 2>&1", "Gem::RemoteFetcher::FetchError").first
176
183
  true
177
184
  end
178
185
  end
@@ -234,6 +241,19 @@ module OrganizationLicenseAudit
234
241
  [$?.success?, output]
235
242
  end
236
243
 
244
+ def sh_with_retry(cmd, retry_on)
245
+ status = false
246
+ result = ""
247
+ 3.times do |i|
248
+ $stderr.puts "Retrying failed command" if i > 0
249
+ status, current = sh(cmd)
250
+ result << current
251
+ return status, result if status
252
+ break unless current.include?(retry_on)
253
+ end
254
+ return status, result
255
+ end
256
+
237
257
  def select_parallel_group!(repos)
238
258
  return unless group = ENV["OLA_GROUP"]
239
259
  group, groups = group.split("/").map(&:to_i)
@@ -1,3 +1,3 @@
1
1
  module OrganizationLicenseAudit
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: organization_license_audit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
@@ -30,7 +30,7 @@ cert_chain:
30
30
  F5etKHZg0j3eHO31/i2HnswY04lqGImUu6aM5EnijFTB7PPW2KwKKM4+kKDYFdlw
31
31
  /0WV1Ng2/Y6qsHwmqGg2VlYj2h4=
32
32
  -----END CERTIFICATE-----
33
- date: 2014-05-12 00:00:00.000000000 Z
33
+ date: 2014-08-29 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: organization_audit
metadata.gz.sig CHANGED
Binary file