Sha256: 8b563c4e01f8c7f1638b2ab064b14f6032a9fea812f82903db7595ec972308dc

Contents?: true

Size: 632 Bytes

Versions: 4

Compression:

Stored size: 632 Bytes

Contents

require "base64"

module Kubes::Compiler::Shared
  module Helpers
    extend Kubes::Compiler::Dsl::Core::Fields
    fields "name"

    def built_image
      return @options[:image] if @options[:image] # override

      path = Kubes.config.state.docker_image_path
      unless File.exist?(path)
        raise "Missing file with docker image built by kubes: #{path}. Try first running: kubes docker build"
      end
      IO.read(path)
    end

    def with_extra(value)
      [value, extra].compact.join('-')
    end

    def extra
      ENV['KUBES_EXTRA']
    end

    def base64(v)
      Base64.encode64(v).strip
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kubes-0.2.3 lib/kubes/compiler/shared/helpers.rb
kubes-0.2.2 lib/kubes/compiler/shared/helpers.rb
kubes-0.2.1 lib/kubes/compiler/shared/helpers.rb
kubes-0.2.0 lib/kubes/compiler/shared/helpers.rb