Commit 9a0f4703 authored by Alejandro Rodríguez's avatar Alejandro Rodríguez

Support `redis` field on /internal/check API endpoint

parent 3ce0677a
v5.9.0
- Support new /internal/post-receive API endpoint for post-receive operations
- Support `redis` field on /internal/check API endpoint
v5.8.1
- Support old versions of ruby without monotonic clock
......
......@@ -3,6 +3,17 @@
require_relative '../lib/gitlab_init'
require_relative '../lib/gitlab_net'
def ping_redis
print "Send ping to redis server: "
if GitlabNet.new.redis_client.ping
print 'OK'
else
abort 'FAILED'
end
puts "\n"
end
#
# GitLab shell check task
#
......@@ -10,11 +21,25 @@ require_relative '../lib/gitlab_net'
print "Check GitLab API access: "
begin
resp = GitlabNet.new.check
if resp.code == "200"
print 'OK'
else
if resp.code != "200"
abort "FAILED. code: #{resp.code}"
end
puts 'OK'
check_values = JSON.parse(resp.body)
if check_values.key?('redis')
print 'Redis available via internal API: '
if check_values['redis']
puts 'OK'
else
abort 'FAILED'
end
else
ping_redis
end
rescue GitlabNet::ApiUnreachableError
abort "FAILED: Failed to connect to internal API"
end
......@@ -30,12 +55,3 @@ else
abort "FAILED"
end
puts "\n"
print "Send ping to redis server: "
if GitlabNet.new.redis_client.ping
print 'OK'
else
abort 'FAILED'
end
puts "\n"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment