Skip to content

Commit

Permalink
improved install, reinstall and upgrade vendor feature (speeds up dep…
Browse files Browse the repository at this point in the history
…loyments with shared vendors)
  • Loading branch information
cordoval committed Sep 28, 2011
1 parent 6b21944 commit 96f9673
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions lib/symfony2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
# Whether to run the bin/vendors script to update vendors
set :update_vendors, false

# run bin/vendors script in mode (upgrade, install (faster if shared /vendor folder) or reinstall)
set :vendors_mode, reinstall

This comment has been minimized.

Copy link
@mbontemps

mbontemps Oct 23, 2011

Contributor

Should'nt this be:

set :vendors_mode, 'reinstall'

?

This comment has been minimized.

Copy link
@cordoval

cordoval Oct 23, 2011

Author Contributor

actually yes but I think the set renders that a string? I am not sure if you can set to a function or class in ruby

we should talk sometime about our projects @mbontemps, message me :D else I will end up very busy later on


# Whether to run cache warmup
set :cache_warmup, true

Expand Down Expand Up @@ -140,10 +143,20 @@
end

namespace :vendors do
desc "Runs the bin/vendors script to update the vendors"
task :update do
desc "Runs the bin/vendors script to install the vendors (fast if already installed)"
task :install do
run "cd #{latest_release} && #{php_bin} bin/vendors install"
end

desc "Runs the bin/vendors script to reinstall the vendors"
task :reinstall do
run "cd #{latest_release} && #{php_bin} bin/vendors install --reinstall"
end

desc "Runs the bin/vendors script to upgrade the vendors"
task :upgrade do
run "cd #{latest_release} && #{php_bin} bin/vendors update"
end
end

namespace :cache do
Expand Down Expand Up @@ -295,7 +308,15 @@
if update_vendors
# share the children first (to get the vendor symlink)
deploy.share_childs
symfony.vendors.update # 1. Update vendors
if vendors_mode == "upgrade"
symfony.vendors.upgrade # 1. Upgrade vendors (upgrade to latest)
elseif vendors_mode == "install"
symfony.vendors.install # 1. Install vendors (fast when shared vendors)
elseif vendors_mode == "reinstall"
symfony.vendors.reinstall # 1. Reinstall vendors (slow)
else
symfony.vendors.reinstall # 1. Reinstall vendors (slow)
end
end

if assets_install
Expand Down

0 comments on commit 96f9673

Please sign in to comment.