With set: deploy_via ,: remote_cache does not work: keep_releases, 5

after the first deployment with set :deploy_via, :copy to make changes to the application now I use:

 set :deploy_via, :remote_cache 

every time I update changes, I create a new version, but I do not delete old versions.

I see in the releases folder:

 20120325165324 20120326132816 20120326150033 20120326150716 20120326151632 20120326161602 20120326171203 

I only want to have a maximum of 3 o 5 releases.

I have in my deploy.rb:

 set :keep_releases, 5 

but it does not work for me.

How to remove old versions after deployment using set :deploy_via, :remote_cache

Thanks!

+6
source share
1 answer

You also need to either manually run cap deploy: cleanup, or it's easier to just call a script from your deployment via a callback, for example. add this to deploy.rb

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

which says: "When the deployment restart task is complete, run the cleanup task." The default value for :keep_releases is 5, so you do not need to add it ... but it will not hurt.

+17
source

Source: https://habr.com/ru/post/911690/


All Articles