Sha256: 9bdc4d99418a18eef5b21be6eb8963e7c791d4095b49ba1eeaba25b152af7a99

Contents?: true

Size: 742 Bytes

Versions: 38

Compression:

Stored size: 742 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 common_args
      %w[--recursive -f ]
    end

    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

38 entries across 38 versions & 1 rubygems

Version Path
kubes-0.7.5 lib/kubes/docker/args/default.rb
kubes-0.7.4 lib/kubes/docker/args/default.rb
kubes-0.7.3 lib/kubes/docker/args/default.rb
kubes-0.7.2 lib/kubes/docker/args/default.rb
kubes-0.7.1 lib/kubes/docker/args/default.rb
kubes-0.7.0 lib/kubes/docker/args/default.rb
kubes-0.6.8 lib/kubes/docker/args/default.rb
kubes-0.6.7 lib/kubes/docker/args/default.rb
kubes-0.6.6 lib/kubes/docker/args/default.rb
kubes-0.6.5 lib/kubes/docker/args/default.rb
kubes-0.6.4 lib/kubes/docker/args/default.rb
kubes-0.6.3 lib/kubes/docker/args/default.rb
kubes-0.6.2 lib/kubes/docker/args/default.rb
kubes-0.6.1 lib/kubes/docker/args/default.rb
kubes-0.6.0 lib/kubes/docker/args/default.rb
kubes-0.5.1 lib/kubes/docker/args/default.rb
kubes-0.5.0 lib/kubes/docker/args/default.rb
kubes-0.4.7 lib/kubes/docker/args/default.rb
kubes-0.4.6 lib/kubes/docker/args/default.rb
kubes-0.4.5 lib/kubes/docker/args/default.rb