Class: Construi::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/construi/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Runner

Returns a new instance of Runner.



14
15
16
# File 'lib/construi/runner.rb', line 14

def initialize(config)
  @config = config
end

Instance Method Details

#run(targets) ⇒ Object



29
30
31
32
33
34
35
36
37
# File 'lib/construi/runner.rb', line 29

def run(targets)
  puts "Construi version: #{Construi::VERSION}"

  setup_docker

  puts "Current directory: #{Dir.pwd}"

  targets.map {|t| Target.new t, @config.target(t) } .each(&:run)
end

#setup_dockerObject



18
19
20
21
22
23
24
25
26
27
# File 'lib/construi/runner.rb', line 18

def setup_docker
  docker_host = ENV['DOCKER_HOST']
  Docker.url = docker_host if docker_host

  puts "Docker url: #{Docker.url}"

  Docker.validate_version!
  Docker.options[:read_timeout] = 60
  Docker.options[:chunk_size] = 8
end