Class: Orchestration::DockerHealthcheck

Inherits:
Object
  • Object
show all
Defined in:
lib/orchestration/docker_healthcheck.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.executeObject



6
7
8
# File 'lib/orchestration/docker_healthcheck.rb', line 6

def self.execute
  new.execute
end

Instance Method Details

#executeObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/orchestration/docker_healthcheck.rb', line 10

def execute
  return_code = 1

  # rubocop:disable Lint/RescueException
  begin
    response = run
    return_code = 0 if success?(response.code)
    puts message(response.code)
  rescue Exception => e
    puts "[#{__FILE__}] ERROR: #{e.inspect}"
  ensure
    exit return_code
  end
  # rubocop:enable Lint/RescueException
end