summaryrefslogtreecommitdiff
path: root/bin/check
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-05 15:55:28 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-05 15:55:28 +0200
commit43a55494f15084fe4c6ed5f9e7703a7bb092af86 (patch)
tree3478175de330bbd90b0557e2db2aa09bbc5fb0a0 /bin/check
parente7a4d233c47743acfc788767c93fd7153269be31 (diff)
downloadgitlab-shell-43a55494f15084fe4c6ed5f9e7703a7bb092af86.tar.gz
add check bin
Diffstat (limited to 'bin/check')
-rwxr-xr-xbin/check31
1 files changed, 31 insertions, 0 deletions
diff --git a/bin/check b/bin/check
new file mode 100755
index 0000000..e0c34ee
--- /dev/null
+++ b/bin/check
@@ -0,0 +1,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