Sha256: 5015b2f5b2369c0406420e40f1181ef087536531876d62629e7c970134ff64fd
Contents?: true
Size: 882 Bytes
Versions: 1
Compression:
Stored size: 882 Bytes
Contents
require 'construi/config' require 'construi/container' require 'construi/image' require 'docker' require 'yaml' module Construi class Runner def initialize(config) @config = config end def run(targets) docker_host = ENV['DOCKER_HOST'] Docker.url = docker_host unless docker_host.nil? puts "Docker running at #{Docker.url}" Docker.validate_version! Docker.options[:read_timeout] = 60 Docker.options[:chunk_size] = 8 initial_image = Image.create(@config.image) { |s| puts s } commands = targets.map { |t| @config.target(t).commands }.flatten final_image = commands.reduce(IntermediateImage.seed(initial_image)) do |image, command| image.run(command) end final_image.delete end end def self.run(targets) Runner.new(Config.load('construi.yml')).run(targets) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
construi-0.4.0 | lib/construi.rb |