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
fd2ebba8
Commit
fd2ebba8
authored
Mar 10, 2020
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Promote Gitlab::Shell#version to a class method
This brings it more inline with, e.g., Gitlab::Workhorse
parent
b29eed55
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
25 deletions
+20
-25
app/views/admin/dashboard/index.html.haml
app/views/admin/dashboard/index.html.haml
+1
-1
config/initializers/5_backend.rb
config/initializers/5_backend.rb
+1
-1
lib/gitlab/shell.rb
lib/gitlab/shell.rb
+15
-15
lib/system_check/gitlab_shell_check.rb
lib/system_check/gitlab_shell_check.rb
+1
-1
lib/tasks/gitlab/info.rake
lib/tasks/gitlab/info.rake
+2
-7
No files found.
app/views/admin/dashboard/index.html.haml
View file @
fd2ebba8
...
...
@@ -99,7 +99,7 @@
%p
GitLab Shell
%span
.float-right
=
Gitlab
::
Shell
.
new
.
version
=
Gitlab
::
Shell
.
version
%p
GitLab Workhorse
%span
.float-right
...
...
config/initializers/5_backend.rb
View file @
fd2ebba8
unless
Rails
.
env
.
test?
required_version
=
Gitlab
::
VersionInfo
.
parse
(
Gitlab
::
Shell
.
version_required
)
current_version
=
Gitlab
::
VersionInfo
.
parse
(
Gitlab
::
Shell
.
new
.
version
)
current_version
=
Gitlab
::
VersionInfo
.
parse
(
Gitlab
::
Shell
.
version
)
unless
current_version
.
valid?
&&
required_version
<=
current_version
warn
"WARNING: This version of GitLab depends on gitlab-shell
#{
required_version
}
, but you're running
#{
current_version
}
. Please update gitlab-shell."
...
...
lib/gitlab/shell.rb
View file @
fd2ebba8
...
...
@@ -34,6 +34,13 @@ module Gitlab
.
join
(
'GITLAB_SHELL_VERSION'
)).
strip
end
# Return GitLab shell version
#
# @return [String] version
def
version
@version
||=
File
.
read
(
gitlab_shell_version_file
).
chomp
if
File
.
readable?
(
gitlab_shell_version_file
)
end
# Return a SSH url for a given project path
#
# @param [String] full_path project path (URL)
...
...
@@ -44,6 +51,14 @@ module Gitlab
private
def
gitlab_shell_path
File
.
expand_path
(
Gitlab
.
config
.
gitlab_shell
.
path
)
end
def
gitlab_shell_version_file
File
.
join
(
gitlab_shell_path
,
'VERSION'
)
end
# Create (if necessary) and link the secret token file
def
generate_and_link_secret_token
secret_file
=
Gitlab
.
config
.
gitlab_shell
.
secret_file
...
...
@@ -244,17 +259,6 @@ module Gitlab
false
end
# Return GitLab shell version
#
# @return [String] version
def
version
gitlab_shell_version_file
=
"
#{
gitlab_shell_path
}
/VERSION"
if
File
.
readable?
(
gitlab_shell_version_file
)
File
.
read
(
gitlab_shell_version_file
).
chomp
end
end
# Check if repository exists on disk
#
# @example Check if repository exists
...
...
@@ -271,10 +275,6 @@ module Gitlab
protected
def
gitlab_shell_path
File
.
expand_path
(
Gitlab
.
config
.
gitlab_shell
.
path
)
end
def
full_path
(
storage
,
dir_name
)
raise
ArgumentError
.
new
(
"Directory name can't be blank"
)
if
dir_name
.
blank?
...
...
lib/system_check/gitlab_shell_check.rb
View file @
fd2ebba8
...
...
@@ -50,7 +50,7 @@ module SystemCheck
end
def
gitlab_shell_version
Gitlab
::
Shell
.
new
.
version
Gitlab
::
Shell
.
version
end
end
end
lib/tasks/gitlab/info.rake
View file @
fd2ebba8
...
...
@@ -82,15 +82,10 @@ namespace :gitlab do
puts
"Using Omniauth:
\t
#{
Gitlab
::
Auth
.
omniauth_enabled?
?
"yes"
.
color
(
:green
)
:
"no"
}
"
puts
"Omniauth Providers:
#{
omniauth_providers
.
join
(
', '
)
}
"
if
Gitlab
::
Auth
.
omniauth_enabled?
# check Gitolite version
gitlab_shell_version_file
=
"
#{
Gitlab
.
config
.
gitlab_shell
.
path
}
/VERSION"
if
File
.
readable?
(
gitlab_shell_version_file
)
gitlab_shell_version
=
File
.
read
(
gitlab_shell_version_file
)
end
# check Gitlab Shell version
puts
""
puts
"GitLab Shell"
.
color
(
:yellow
)
puts
"Version:
\t
#{
gitlab_shell_
version
||
"unknown"
.
color
(
:red
)
}
"
puts
"Version:
\t
#{
Gitlab
::
Shell
.
version
||
"unknown"
.
color
(
:red
)
}
"
puts
"Repository storage paths:"
Gitlab
::
GitalyClient
::
StorageSettings
.
allow_disk_access
do
Gitlab
.
config
.
repositories
.
storages
.
each
do
|
name
,
repository_storage
|
...
...
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