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
Tatuya Kamada
gitlab-ce
Commits
e73b68a7
Commit
e73b68a7
authored
Dec 06, 2016
by
Semyon Pupkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add git version to gitlab:env:info
https://gitlab.com/gitlab-org/gitlab-ce/issues/25376
parent
58758bd5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
0 deletions
+44
-0
changelogs/unreleased/add-git-version-to-system-info.yml
changelogs/unreleased/add-git-version-to-system-info.yml
+4
-0
lib/tasks/gitlab/info.rake
lib/tasks/gitlab/info.rake
+3
-0
spec/tasks/gitlab/info_rake_spec.rb
spec/tasks/gitlab/info_rake_spec.rb
+37
-0
No files found.
changelogs/unreleased/add-git-version-to-system-info.yml
0 → 100644
View file @
e73b68a7
---
title
:
Add git version to gitlab:env:info
merge_request
:
9128
author
:
Semyon Pupkov
lib/tasks/gitlab/info.rake
View file @
e73b68a7
...
@@ -14,6 +14,8 @@ namespace :gitlab do
...
@@ -14,6 +14,8 @@ namespace :gitlab do
rake_version
=
run_and_match
(
%w(rake --version)
,
/[\d\.]+/
).
try
(
:to_s
)
rake_version
=
run_and_match
(
%w(rake --version)
,
/[\d\.]+/
).
try
(
:to_s
)
# check redis version
# check redis version
redis_version
=
run_and_match
(
%w(redis-cli --version)
,
/redis-cli (\d+\.\d+\.\d+)/
).
to_a
redis_version
=
run_and_match
(
%w(redis-cli --version)
,
/redis-cli (\d+\.\d+\.\d+)/
).
to_a
# check Git version
git_version
=
run_and_match
([
Gitlab
.
config
.
git
.
bin_path
,
'--version'
],
/git version ([\d\.]+)/
).
to_a
puts
""
puts
""
puts
"System information"
.
color
(
:yellow
)
puts
"System information"
.
color
(
:yellow
)
...
@@ -26,6 +28,7 @@ namespace :gitlab do
...
@@ -26,6 +28,7 @@ namespace :gitlab do
puts
"Bundler Version:
#{
bunder_version
||
"unknown"
.
color
(
:red
)
}
"
puts
"Bundler Version:
#{
bunder_version
||
"unknown"
.
color
(
:red
)
}
"
puts
"Rake Version:
\t
#{
rake_version
||
"unknown"
.
color
(
:red
)
}
"
puts
"Rake Version:
\t
#{
rake_version
||
"unknown"
.
color
(
:red
)
}
"
puts
"Redis Version:
\t
#{
redis_version
[
1
]
||
"unknown"
.
color
(
:red
)
}
"
puts
"Redis Version:
\t
#{
redis_version
[
1
]
||
"unknown"
.
color
(
:red
)
}
"
puts
"Git Version:
\t
#{
git_version
[
1
]
||
"unknown"
.
color
(
:red
)
}
"
puts
"Sidekiq Version:
#{
Sidekiq
::
VERSION
}
"
puts
"Sidekiq Version:
#{
Sidekiq
::
VERSION
}
"
# check database adapter
# check database adapter
...
...
spec/tasks/gitlab/info_rake_spec.rb
0 → 100644
View file @
e73b68a7
require
'rake_helper'
describe
'gitlab:env:info'
do
before
do
Rake
.
application
.
rake_require
'tasks/gitlab/info'
stub_warn_user_is_not_gitlab
allow
(
Gitlab
::
Popen
).
to
receive
(
:popen
)
end
describe
'git version'
do
before
do
allow
(
Gitlab
::
Popen
).
to
receive
(
:popen
).
with
([
Gitlab
.
config
.
git
.
bin_path
,
'--version'
])
.
and_return
(
git_version
)
end
context
'when git installed'
do
let
(
:git_version
)
{
'git version 2.10.0'
}
it
'prints git version'
do
run_rake_task
(
'gitlab:env:info'
)
expect
(
$stdout
.
string
).
to
match
(
/Git Version:(.*)2.10.0/
)
end
end
context
'when git not installed'
do
let
(
:git_version
)
{
''
}
it
'prints unknown'
do
run_rake_task
(
'gitlab:env:info'
)
expect
(
$stdout
.
string
).
to
match
(
/Git Version:(.*)unknown/
)
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