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
32ba92a7
Commit
32ba92a7
authored
Jun 04, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
parents
8b089fa2
92878655
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
CHANGELOG
CHANGELOG
+1
-0
lib/gitlab/upgrader.rb
lib/gitlab/upgrader.rb
+8
-3
spec/lib/gitlab/upgrader_spec.rb
spec/lib/gitlab/upgrader_spec.rb
+15
-0
No files found.
CHANGELOG
View file @
32ba92a7
...
...
@@ -54,6 +54,7 @@ v 7.11.4
v 7.11.3
- no changes
- Fix upgrader script (Martins Polakovs)
v 7.11.2
- no changes
...
...
lib/gitlab/upgrader.rb
View file @
32ba92a7
...
...
@@ -43,10 +43,15 @@ module Gitlab
end
def
latest_version_raw
git_tags
=
fetch_git_tags
git_tags
=
git_tags
.
select
{
|
version
|
version
=~
/v\d+\.\d+\.\d+\Z/
}
git_versions
=
git_tags
.
map
{
|
tag
|
Gitlab
::
VersionInfo
.
parse
(
tag
.
match
(
/v\d+\.\d+\.\d+/
).
to_s
)
}
"v
#{
git_versions
.
sort
.
last
.
to_s
}
"
end
def
fetch_git_tags
remote_tags
,
_
=
Gitlab
::
Popen
.
popen
(
%W(git ls-remote --tags https://gitlab.com/gitlab-org/gitlab-ce.git)
)
git_tags
=
remote_tags
.
split
(
"
\n
"
).
grep
(
/tags\/v
#{
current_version
.
major
}
/
)
git_tags
=
git_tags
.
select
{
|
version
|
version
=~
/v\d\.\d\.\d\Z/
}
last_tag
=
git_tags
.
last
.
match
(
/v\d\.\d\.\d/
).
to_s
remote_tags
.
split
(
"
\n
"
).
grep
(
/tags\/v
#{
current_version
.
major
}
/
)
end
def
update_commands
...
...
spec/lib/gitlab/upgrader_spec.rb
View file @
32ba92a7
...
...
@@ -20,5 +20,20 @@ describe Gitlab::Upgrader do
upgrader
.
stub
(
current_version_raw:
"5.3.0"
)
expect
(
upgrader
.
latest_version_raw
).
to
eq
(
"v5.4.2"
)
end
it
'should get the latest version from tags'
do
allow
(
upgrader
).
to
receive
(
:fetch_git_tags
).
and_return
([
'6f0733310546402c15d3ae6128a95052f6c8ea96 refs/tags/v7.1.1'
,
'facfec4b242ce151af224e20715d58e628aa5e74 refs/tags/v7.1.1^{}'
,
'f7068d99c79cf79befbd388030c051bb4b5e86d4 refs/tags/v7.10.4'
,
'337225a4fcfa9674e2528cb6d41c46556bba9dfa refs/tags/v7.10.4^{}'
,
'880e0ba0adbed95d087f61a9a17515e518fc6440 refs/tags/v7.11.1'
,
'6584346b604f981f00af8011cd95472b2776d912 refs/tags/v7.11.1^{}'
,
'43af3e65a486a9237f29f56d96c3b3da59c24ae0 refs/tags/v7.11.2'
,
'dac18e7728013a77410e926a1e64225703754a2d refs/tags/v7.11.2^{}'
,
'0bf21fd4b46c980c26fd8c90a14b86a4d90cc950 refs/tags/v7.9.4'
,
'b10de29edbaff7219547dc506cb1468ee35065c3 refs/tags/v7.9.4^{}'
])
expect
(
upgrader
.
latest_version_raw
).
to
eq
(
"v7.11.2"
)
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