Commit 581f4663 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix upgrader

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 1f43fa20
...@@ -43,15 +43,15 @@ module Gitlab ...@@ -43,15 +43,15 @@ module Gitlab
def latest_version_raw def latest_version_raw
git_tags = `git ls-remote --tags origin | grep tags\/v#{current_version.major}` git_tags = `git ls-remote --tags origin | grep tags\/v#{current_version.major}`
git_tags = git_tags.lines.to_a.select { |version| version =~ /v\d\.\d\.\d\Z/ } git_tags = git_tags.lines.to_a.select { |version| version =~ /v\d\.\d\.\d-ee\Z/ }
last_tag = git_tags.last.match(/v\d\.\d\.\d/).to_s last_tag = git_tags.last.match(/v\d\.\d\.\d-ee/).to_s
end end
def update_commands def update_commands
{ {
"Stash changed files" => "git stash", "Stash changed files" => "git stash",
"Get latest code" => "git fetch", "Get latest code" => "git fetch",
"Switch to new version" => "git checkout -b v#{latest_version}", "Switch to new version" => "git checkout -b v#{latest_version}-ee",
"Install gems" => "bundle", "Install gems" => "bundle",
"Migrate DB" => "bundle exec rake db:migrate RAILS_ENV=production", "Migrate DB" => "bundle exec rake db:migrate RAILS_ENV=production",
"Recompile assets" => "bundle exec rake assets:clean assets:precompile RAILS_ENV=production", "Recompile assets" => "bundle exec rake assets:clean assets:precompile RAILS_ENV=production",
......
...@@ -17,8 +17,8 @@ describe Gitlab::Upgrader do ...@@ -17,8 +17,8 @@ describe Gitlab::Upgrader do
describe 'latest_version_raw' do describe 'latest_version_raw' do
it 'should be latest version for GitLab 5' do it 'should be latest version for GitLab 5' do
upgrader.stub(current_version_raw: "5.3.0") upgrader.stub(current_version_raw: "6.3.0-ee")
upgrader.latest_version_raw.should == "v5.4.2" upgrader.latest_version_raw.should match(/v6\.\d\.\d-ee/)
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment