Sha256: 4f32a26e30fdac3192b3e04829d4784f9e444fb112665faabe598d6c864dd38e

Contents?: true

Size: 687 Bytes

Versions: 20

Compression:

Stored size: 687 Bytes

Contents

module Kubes::Docker::Args
  class Default
    def initialize(name, image_name, options={})
      @name, @image_name, @options = name.to_s, image_name, options
      @dockerfile = "Dockerfile"
    end

    def args
      case @name
      when "build"
        build_args
      when "push"
        [@image_name]
      else
        []
      end
    end

    def build_args
      ["-t #{@image_name} -f #{@dockerfile} ."]
    end


  private
    def resource_path
      [".kubes/output", @options[:role], resource].compact.join('/')
    end

    def resource
      return unless r = @options[:resource] # intentional assignment
      r.include?(".yaml") ? r : "#{r}.yaml"
    end

  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
kubes-0.9.3 lib/kubes/docker/args/default.rb
kubes-0.9.2 lib/kubes/docker/args/default.rb
kubes-0.9.1 lib/kubes/docker/args/default.rb
kubes-0.9.0 lib/kubes/docker/args/default.rb
kubes-0.8.10 lib/kubes/docker/args/default.rb
kubes-0.8.9 lib/kubes/docker/args/default.rb
kubes-0.8.8 lib/kubes/docker/args/default.rb
kubes-0.8.7 lib/kubes/docker/args/default.rb
kubes-0.8.6 lib/kubes/docker/args/default.rb
kubes-0.8.5 lib/kubes/docker/args/default.rb
kubes-0.8.4 lib/kubes/docker/args/default.rb
kubes-0.8.3 lib/kubes/docker/args/default.rb
kubes-0.8.2 lib/kubes/docker/args/default.rb
kubes-0.8.1 lib/kubes/docker/args/default.rb
kubes-0.8.0 lib/kubes/docker/args/default.rb
kubes-0.7.10 lib/kubes/docker/args/default.rb
kubes-0.7.9 lib/kubes/docker/args/default.rb
kubes-0.7.8 lib/kubes/docker/args/default.rb
kubes-0.7.7 lib/kubes/docker/args/default.rb
kubes-0.7.6 lib/kubes/docker/args/default.rb