Sha256: a24492067020a26d89a80d246c35848f004ea340247981fa628885eea538548a

Contents?: true

Size: 553 Bytes

Versions: 6

Compression:

Stored size: 553 Bytes

Contents


module Construi

  class Target
    attr_reader :name, :config

    def initialize(name, config)
      @name = name
      @config = config
    end

    def commands
      @config.commands
    end

    def run
      puts "Running #{name}...".green

      final_image = IntermediateImage.seed(initial_image).reduce(commands) do |image, command|
        puts
        puts " > #{command}".green
        image.run(command, @config.env)
      end

      final_image.delete
    end

    def initial_image
      return Image.from(@config)
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
construi-0.35.2 lib/construi/target.rb
construi-0.35.1 lib/construi/target.rb
construi-0.35.0 lib/construi/target.rb
construi-0.33.0 lib/construi/target.rb
construi-0.32.0 lib/construi/target.rb
construi-0.31.0 lib/construi/target.rb