Class: Kubes::CLI::Docker

Inherits:
Kubes::Command show all
Defined in:
lib/kubes/cli/docker.rb

Instance Method Summary collapse

Methods inherited from Kubes::Command

alter_command_description, check_project!, command_help, dispatch, exit_on_failure?, website

Instance Method Details

#buildObject



6
7
8
9
10
# File 'lib/kubes/cli/docker.rb', line 6

def build
  builder = Kubes::Docker.new(options, "build")
  builder.run
  push if options[:push]
end

#nameObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/kubes/cli/docker.rb', line 15

def name
  builder = Kubes::Docker.new(options, "build")
  name = builder.read_image_name
  if name
    puts name
  else
    $stderr.puts(<<~EOL)
      WARN: docker image has not yet been built. Please first run:

          kubes docker build

    EOL
  end
end

#pushObject



33
34
35
36
# File 'lib/kubes/cli/docker.rb', line 33

def push
  pusher = Kubes::Docker.new(options, "push")
  pusher.run
end