Class: GrokCLI::Docker::Boot

Inherits:
Object
  • Object
show all
Defined in:
lib/grok_cli/docker/boot.rb

Instance Method Summary collapse

Constructor Details

#initialize(config = Configuration.new) ⇒ Boot

Returns a new instance of Boot.



3
4
5
# File 'lib/grok_cli/docker/boot.rb', line 3

def initialize(config = Configuration.new)
  @config = config
end

Instance Method Details

#executeObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/grok_cli/docker/boot.rb', line 7

def execute
  system <<~CMD

    docker-machine ls | grep #{@config.machine_name} | grep -qi Running

    if [ $? -ne 0 ]
    then
      docker-machine start #{@config.machine_name}
      docker-machine regenerate-certs #{@config.machine_name}
    fi

  CMD
end