Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capistrano - clean up old releases

Tags:

capistrano

Usually when using capistrano, I will go and manually delete old releases from a deployed application. I understand that you can run cap deploy:cleanup but that still leaves 5 releases. Is this it's intended purpose? Is there another way to cleanup old releases to just 1 previous deploy?

like image 432
Josh Avatar asked Sep 27 '22 10:09

Josh


2 Answers

You can use the :keep_releases variable to override the default of 5. Check this out.

like image 155
jcrossley3 Avatar answered Oct 22 '22 01:10

jcrossley3


You could do this automatically by setting this in your deploy.rb

set :keep_releases, 1
after "deploy:update", "deploy:cleanup" 

In the past(I don't know exactly which version) this callback was the default, but later the developer decided to leave it to the user to decide. In capistrano 3 it was added back to the default deploy flow.

like image 134
Diego Plentz Avatar answered Oct 22 '22 01:10

Diego Plentz