Skip to content

Commit

Permalink
retry image provision
Browse files Browse the repository at this point in the history
  • Loading branch information
arlimus committed Oct 21, 2015
1 parent 7df02ed commit fd09fe6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/integration/docker_run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

class DockerRunner
def initialize(conf_path = nil)
@conf_path = conf_path ||
ENV['config']
@conf_path = conf_path || ENV['config']
unless File.file?(@conf_path)
fail "Can't find configuration in #{@conf_path}"
end
Expand Down Expand Up @@ -63,6 +62,7 @@ def run_on_target(name, &block)
end

def provision_image(image, prov, files)
tries ||= 3
return image if prov['script'].nil?
path = File.join(File.dirname(@conf_path), prov['script'])
unless File.file?(path)
Expand All @@ -73,6 +73,8 @@ def provision_image(image, prov, files)
dst = "/bootstrap#{files.length}.sh"
files.push(dst)
image.insert_local('localPath' => path, 'outputPath' => dst)
rescue StandardError => _
retry unless (tries -= 1).zero?
end

def bootstrap_image(name, image)
Expand Down

1 comment on commit fd09fe6

@chef-delivery
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delivery Status:

Verify Build Acceptance
Unit Unit Provision
Lint Lint Deploy
Syntax Syntax Smoke
Quality Functional
Security
Publish

Please sign in to comment.