diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-02-25 15:15:18 +0400 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-03-03 11:40:30 +0400 |
commit | d6b0ac96f7b2952edb8aad0efcd48e0bccd23fe0 (patch) | |
tree | 430c28c845eea9ca53103b7e5098cefd230dadc8 /lib/gitlab/upgrader.rb | |
parent | b30b9c9c464e3b6611c80b6436c8346eb2bbcccf (diff) |
Invoke Kernel#system with separate arguments
Diffstat (limited to 'lib/gitlab/upgrader.rb')
-rw-r--r-- | lib/gitlab/upgrader.rb | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/gitlab/upgrader.rb b/lib/gitlab/upgrader.rb index f17ad0d79cc..0fe4888665d 100644 --- a/lib/gitlab/upgrader.rb +++ b/lib/gitlab/upgrader.rb @@ -50,21 +50,25 @@ module Gitlab def update_commands { - "Stash changed files" => "git stash", - "Get latest code" => "git fetch", - "Switch to new version" => "git checkout v#{latest_version}", - "Install gems" => "bundle", - "Migrate DB" => "bundle exec rake db:migrate RAILS_ENV=production", - "Recompile assets" => "bundle exec rake assets:clean assets:precompile RAILS_ENV=production", - "Clear cache" => "bundle exec rake cache:clear RAILS_ENV=production" + "Stash changed files" => %W(git stash), + "Get latest code" => %W(git fetch), + "Switch to new version" => %W(git checkout v#{latest_version}), + "Install gems" => %W(bundle), + "Migrate DB" => %W(bundle exec rake db:migrate), + "Recompile assets" => %W(bundle exec rake assets:clean assets:precompile), + "Clear cache" => %W(bundle exec rake cache:clear) } end + def env + {'RAILS_ENV' => 'production'} + end + def upgrade update_commands.each do |title, cmd| puts title - puts " -> #{cmd}" - if system(cmd) + puts " -> #{cmd.join(' ')}" + if system(env, *cmd) puts " -> OK" else puts " -> FAILED" |