Commit eb79e568 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Refactored app/init script check to use dynamic skip reason

parent 706d49b2
......@@ -7,26 +7,22 @@ module SystemCheck
set_skip_reason 'skipped (omnibus-gitlab has no init script)'
def skip?
omnibus_gitlab?
end
return true if omnibus_gitlab?
def multi_check
recipe_path = Rails.root.join('lib/support/init.d/', 'gitlab')
unless init_file_exists?
self.skip_reason = "can't check because of previous errors"
unless File.exist?(SCRIPT_PATH)
$stdout.puts "can't check because of previous errors".color(:magenta)
return
true
end
end
def check?
recipe_path = Rails.root.join('lib/support/init.d/', 'gitlab')
recipe_content = File.read(recipe_path)
script_content = File.read(SCRIPT_PATH)
if recipe_content == script_content
$stdout.puts 'yes'.color(:green)
else
$stdout.puts 'no'.color(:red)
show_error
end
recipe_content == script_content
end
def show_error
......@@ -38,6 +34,12 @@ module SystemCheck
)
fix_and_rerun
end
private
def init_file_exists?
File.exist?(SCRIPT_PATH)
end
end
end
end
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