summaryrefslogtreecommitdiff
path: root/bin/check
blob: e0c34ee592875ea389cba950f5e919bd46994171 (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
#!/usr/bin/env ruby

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

#
# GitLab shell check task
#

print "Check GitLab API access: "
resp = GitlabNet.new.check
if resp.code == "200"
  print 'OK'
else
  puts "FAILED. code: #{resp.code}"
end

puts "\nCheck directories and files: "

config = GitlabConfig.new
dirs = [config.repos_path, config.auth_file]

dirs.each do |dir|
  print "\t#{dir}: "
  if File.exists?(dir)
    print 'OK'
  else
    puts "FAILED"
  end
  puts "\n"
end