Deleting old releases?

1,062 views
Skip to first unread message

growvotes

unread,
Apr 24, 2008, 10:23:32 PM4/24/08
to Capistrano
It seems like overkill to me to keep the old releases of my
application on my server and in my remote subversion. Plus, it's
quickly filling up my storage on my server with each new deployment.

Is there a way to delete, say the oldest release when I make a new
deployment? Or is this just unwise?

Jamis Buck

unread,
Apr 24, 2008, 10:34:35 PM4/24/08
to capis...@googlegroups.com
Check deploy:cleanup. By default it removes all but the five most
recently deployed versions.

cap --explain deploy:cleanup

- Jamis

> --~--~---------~--~----~------------~-------~--~----~
> To unsubscribe from this group, send email to capistrano-...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/capistrano
> -~----------~----~----~----~------~----~------~--~---
>

Josh Schairbaum

unread,
Apr 24, 2008, 11:21:08 PM4/24/08
to capis...@googlegroups.com
If you run cap deploy:cleanup it will delete all but the last 3
releases.

You can set the number of releases to keep, but you'll have to look in
the docs for the variable name, I can't remember.

Sorry,
Josh

Rafael G.

unread,
Apr 25, 2008, 4:53:34 AM4/25/08
to capis...@googlegroups.com
Josh Schairbaum escribió:

>
> You can set the number of releases to keep, but you'll have to look in
> the docs for the variable name, I can't remember.
>
>
I remember :)

set :keep_releases, 4

regards!

--
Rafael Garcia Ortega

rgo.vcf

Rob Sanheim

unread,
Apr 28, 2008, 8:16:19 AM4/28/08
to capis...@googlegroups.com
2008/4/25 Rafael G. <r...@aspgems.com>:

> Josh Schairbaum escribió:
>
> >
> > You can set the number of releases to keep, but you'll have to look in
> > the docs for the variable name, I can't remember.
> >
> >
> I remember :)
>
> set :keep_releases, 4
>
> regards!
>

As an aside, does anyone else notice that the deletion seems to take
forever? I thought a rm -rf would be pretty fast, even if there is a
lot of cruft in each release directory?

- Rob

Jamis Buck

unread,
Apr 28, 2008, 9:37:53 AM4/28/08
to capis...@googlegroups.com
It depends on the filesystem. On our FreeBSD systems, cleaning up even
just a handful of old releases can take (as you said) forever, but on
our linux boxes the deletes go significantly faster.

If anyone knows a faster way for deleting subtrees, I'm all ears,
because the speed of deletion is the only thing that is keeping me
from making deploy:cleanup automatically execute after a deploy.

- Jamis

David Masover

unread,
Apr 28, 2008, 11:49:35 AM4/28/08
to capis...@googlegroups.com
One possibility is to (somehow) make each release use hardlinks from the last. I'm not sure how to do that consistently across versions, though, and that wouldn't make it fast, just not quite as slow.

But yes, it does depend on the filesystem, and some are actually slower at unlink() calls than others.

I do actually make it automatically execute after a deploy, because each one is going to take as long as any other, so better to feel the pain in small doses than all at once.

Mislav Marohnić

unread,
Apr 28, 2008, 12:08:36 PM4/28/08
to capis...@googlegroups.com
On Mon, Apr 28, 2008 at 5:49 PM, David Masover <da...@3mix.com> wrote:
One possibility is to (somehow) make each release use hardlinks from the last. I'm not sure how to do that consistently across versions, though

It's possible with git and deploy_via :remote_cache. The cache clone pulls from upstream while releases clone from cache. "git clone" command can be told to make hard links locally.

growvotes

unread,
Apr 28, 2008, 6:03:25 PM4/28/08
to Capistrano
Just want to say thanks for the excellent feedback!
Reply all
Reply to author
Forward
0 new messages