Class: Kubes::Docker

Inherits:
Object
  • Object
show all
Includes:
Strategy::ImageName
Defined in:
lib/kubes/docker.rb

Defined Under Namespace

Modules: Args, Strategy

Instance Method Summary collapse

Methods included from Strategy::ImageName

#args, #custom, #default, #generate_name, #git_sha, #image_name, #image_state_path, #read_image_name, #repo, #reserve_image_name, #store_image_name

Constructor Details

#initialize(options, name) ⇒ Docker

Returns a new instance of Docker.



3
4
5
6
# File 'lib/kubes/docker.rb', line 3

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

Instance Method Details

#runObject



8
9
10
11
# File 'lib/kubes/docker.rb', line 8

def run
  strategy = strategy_class.new(@options, @name) # @name: docker or push
  strategy.run
end

#strategy_classObject



13
14
15
16
17
# File 'lib/kubes/docker.rb', line 13

def strategy_class
  strategy = Kubes.config.builder.to_s.camelize # IE: Docker or Gcloud
  klass_name = "Kubes::Docker::Strategy::#{@name.camelize}::#{strategy}"
  klass_name.constantize
end