Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
eb79e568
Commit
eb79e568
authored
Sep 04, 2017
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored app/init script check to use dynamic skip reason
parent
706d49b2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
lib/system_check/app/init_script_up_to_date_check.rb
lib/system_check/app/init_script_up_to_date_check.rb
+15
-13
No files found.
lib/system_check/app/init_script_up_to_date_check.rb
View file @
eb79e568
...
@@ -7,26 +7,22 @@ module SystemCheck
...
@@ -7,26 +7,22 @@ module SystemCheck
set_skip_reason
'skipped (omnibus-gitlab has no init script)'
set_skip_reason
'skipped (omnibus-gitlab has no init script)'
def
skip?
def
skip?
omnibus_gitlab?
return
true
if
omnibus_gitlab?
end
def
multi_check
unless
init_file_exists?
recipe_path
=
Rails
.
root
.
join
(
'lib/support/init.d/'
,
'gitlab'
)
self
.
skip_reason
=
"can't check because of previous errors"
unless
File
.
exist?
(
SCRIPT_PATH
)
true
$stdout
.
puts
"can't check because of previous errors"
.
color
(
:magenta
)
end
return
end
end
def
check?
recipe_path
=
Rails
.
root
.
join
(
'lib/support/init.d/'
,
'gitlab'
)
recipe_content
=
File
.
read
(
recipe_path
)
recipe_content
=
File
.
read
(
recipe_path
)
script_content
=
File
.
read
(
SCRIPT_PATH
)
script_content
=
File
.
read
(
SCRIPT_PATH
)
if
recipe_content
==
script_content
recipe_content
==
script_content
$stdout
.
puts
'yes'
.
color
(
:green
)
else
$stdout
.
puts
'no'
.
color
(
:red
)
show_error
end
end
end
def
show_error
def
show_error
...
@@ -38,6 +34,12 @@ module SystemCheck
...
@@ -38,6 +34,12 @@ module SystemCheck
)
)
fix_and_rerun
fix_and_rerun
end
end
private
def
init_file_exists?
File
.
exist?
(
SCRIPT_PATH
)
end
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment