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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
c09ad191
Commit
c09ad191
authored
Jun 02, 2017
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor Elasticsearch checks to SystemCheck
parent
7b164cb7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
16 deletions
+27
-16
lib/system_check/app/elasticsearch_check.rb
lib/system_check/app/elasticsearch_check.rb
+25
-0
lib/tasks/gitlab/check.rake
lib/tasks/gitlab/check.rake
+2
-16
No files found.
lib/system_check/app/elasticsearch_check.rb
0 → 100644
View file @
c09ad191
module
SystemCheck
module
App
class
ElasticsearchCheck
<
SystemCheck
::
BaseCheck
set_name
'Elasticsearch version 5.1 - 5.3?'
set_skip_reason
'skipped (elasticsearch is disabled)'
set_check_pass
->
{
"yes (
#{
self
.
current_version
}
)"
}
set_check_fail
->
{
"no (
#{
self
.
current_version
}
)"
}
def
self
.
current_version
@current_version
||=
begin
client
=
Gitlab
::
Elastic
::
Client
.
build
(
current_application_settings
.
elasticsearch_config
)
Gitlab
::
VersionInfo
.
parse
(
client
.
info
[
'version'
][
'number'
])
end
end
def
skip?
!
current_application_settings
.
elasticsearch_indexing?
end
def
check?
current_version
.
major
==
5
&&
(
1
..
3
).
cover?
(
version
.
minor
)
end
end
end
end
lib/tasks/gitlab/check.rake
View file @
c09ad191
...
@@ -33,11 +33,11 @@ namespace :gitlab do
...
@@ -33,11 +33,11 @@ namespace :gitlab do
SystemCheck
::
App
::
RedisVersionCheck
,
SystemCheck
::
App
::
RedisVersionCheck
,
SystemCheck
::
App
::
RubyVersionCheck
,
SystemCheck
::
App
::
RubyVersionCheck
,
SystemCheck
::
App
::
GitVersionCheck
,
SystemCheck
::
App
::
GitVersionCheck
,
SystemCheck
::
App
::
ActiveUsersCheck
SystemCheck
::
App
::
ActiveUsersCheck
,
SystemCheck
::
App
::
ElasticsearchCheck
]
]
SystemCheck
.
run
(
'GitLab'
,
checks
)
SystemCheck
.
run
(
'GitLab'
,
checks
)
check_elasticsearch
if
current_application_settings
.
elasticsearch_indexing?
end
end
end
end
...
@@ -661,20 +661,6 @@ namespace :gitlab do
...
@@ -661,20 +661,6 @@ namespace :gitlab do
end
end
end
end
def
check_elasticsearch
client
=
Gitlab
::
Elastic
::
Client
.
build
(
current_application_settings
.
elasticsearch_config
)
print
"Elasticsearch version 5.1 - 5.3? ... "
version
=
Gitlab
::
VersionInfo
.
parse
(
client
.
info
[
"version"
][
"number"
])
if
version
.
major
==
5
&&
(
1
..
3
).
cover?
(
version
.
minor
)
puts
"yes (
#{
version
}
)"
.
color
(
:green
)
else
puts
"no, you have
#{
version
}
"
.
color
(
:red
)
end
end
def
check_gitlab_geo_node
(
node
)
def
check_gitlab_geo_node
(
node
)
display_error
=
proc
do
|
e
|
display_error
=
proc
do
|
e
|
puts
'no'
.
color
(
:red
)
puts
'no'
.
color
(
:red
)
...
...
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