Sha256: 0a6040aabc84347bddb5eb9e522c4bdae8634771fa11635cf5e4222437cc0abe

Contents?: true

Size: 781 Bytes

Versions: 24

Compression:

Stored size: 781 Bytes

Contents

class Ufo::Docker
  class Variables
    @@variables_path = "#{Ufo.root}/.ufo/settings/dockerfile_variables.yml"

    def initialize(full_image_name, options={})
      @full_image_name, @options = full_image_name, options
    end

    def update
      data = current_data
      data[Ufo.env] ||= {}
      data[Ufo.env]["base_image"] = @full_image_name
      pretty_path = @@variables_path.sub("#{Ufo.root}/", "")
      IO.write(@@variables_path, YAML.dump(data))

      unless @options[:mute]
        puts "The #{pretty_path} base_image has been updated with the latest base image:".color(:green)
        puts "  #{@full_image_name}".color(:green)
      end
    end

    def current_data
      File.exist?(@@variables_path) ? YAML.load_file(@@variables_path) : {}
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
ufo-5.0.7 lib/ufo/docker/variables.rb
ufo-5.0.6 lib/ufo/docker/variables.rb
ufo-5.0.5 lib/ufo/docker/variables.rb
ufo-5.0.4 lib/ufo/docker/variables.rb
ufo-5.0.3 lib/ufo/docker/variables.rb
ufo-5.0.2 lib/ufo/docker/variables.rb
ufo-5.0.1 lib/ufo/docker/variables.rb
ufo-5.0.0 lib/ufo/docker/variables.rb
ufo-4.6.3 lib/ufo/docker/variables.rb
ufo-4.6.2 lib/ufo/docker/variables.rb
ufo-4.6.1 lib/ufo/docker/variables.rb
ufo-4.6.0 lib/ufo/docker/variables.rb
ufo-4.5.11 lib/ufo/docker/variables.rb
ufo-4.5.10 lib/ufo/docker/variables.rb
ufo-4.5.9 lib/ufo/docker/variables.rb
ufo-4.5.8 lib/ufo/docker/variables.rb
ufo-4.5.7 lib/ufo/docker/variables.rb
ufo-4.5.6 lib/ufo/docker/variables.rb
ufo-4.5.5 lib/ufo/docker/variables.rb
ufo-4.5.4 lib/ufo/docker/variables.rb