Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2018-11-28 03:08:31 +0300
committerMichael Kozono <mkozono@gmail.com>2018-12-04 00:51:46 +0300
commit6855e6b5864abcf01689720424a4bea4c3b9fec2 (patch)
tree627226eee254d76b41d16cfd99f07be3f7c3f6b5 /lib/system_check/gitaly_check.rb
parentc3c25174e3397ca3f301b539477e6568c676d264 (diff)
Extract system check rake task logic
These changes make the code more reusable, testable, and most importantly, overrideable.
Diffstat (limited to 'lib/system_check/gitaly_check.rb')
-rw-r--r--lib/system_check/gitaly_check.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/system_check/gitaly_check.rb b/lib/system_check/gitaly_check.rb
new file mode 100644
index 00000000000..3d2517a7aca
--- /dev/null
+++ b/lib/system_check/gitaly_check.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+module SystemCheck
+ class GitalyCheck < BaseCheck
+ set_name 'Gitaly:'
+
+ def multi_check
+ Gitlab::HealthChecks::GitalyCheck.readiness.each do |result|
+ $stdout.print "#{result.labels[:shard]} ... "
+
+ if result.success
+ $stdout.puts 'OK'.color(:green)
+ else
+ $stdout.puts "FAIL: #{result.message}".color(:red)
+ end
+ end
+ end
+ end
+end