Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

with set :deploy_via, :remote_cache not working set :keep_releases, 5

after first deploy with set :deploy_via, :copy for make changes in app now I'm using:

set :deploy_via, :remote_cache

each time that I update changes make a new release but not remove the old releases.

I can see in releases folder:

20120325165324  20120326132816  20120326150033  20120326150716  20120326151632  20120326161602  20120326171203

I want only have 3 o 5 releases maximum.

I have in my deploy.rb:

set :keep_releases, 5

but this is does not works for me.

How can I remove old releases after deploy with set :deploy_via, :remote_cache

Thank you!

like image 679
hyperrjas Avatar asked Mar 26 '12 17:03

hyperrjas


1 Answers

You also need to either manually run cap deploy:cleanup, or simpler, just call in from within your deploy script via a callback, e.g. add this to deploy.rb

after "deploy:restart", "deploy:cleanup" 

which says, "when the restart task of deployment is complete, then run the cleanup task". The default for :keep_releases is 5, so you don't really need to add it ... but it doesn't hurt.

like image 102
Tom Harrison Avatar answered Sep 21 '22 21:09

Tom Harrison