summaryrefslogtreecommitdiff
path: root/bin/check
blob: 363cb6a259a44ee9ef8c81a094198acc8c25a9e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env ruby

require_relative '../lib/gitlab_init'
require_relative '../lib/gitlab_net'

#
# GitLab shell check task
#

print "Check GitLab API access: "
begin
  resp = GitlabNet.new.check
  if resp.code == "200"
    print 'OK'
  else
    abort "FAILED. code: #{resp.code}"
  end
rescue GitlabNet::ApiUnreachableError
  abort "FAILED: Failed to connect to internal API"
end


puts "\nCheck directories and files: "

config = GitlabConfig.new

abort("ERROR: missing option in config.yml") unless config.auth_file
print "\t#{config.auth_file}: "
if File.exists?(config.auth_file)
  print 'OK'
else
  abort "FAILED"
end
puts "\n"

print "Send ping to redis server: "
abort unless GitlabNet.new.redis_client.ping