How to set release limit while using php-deployer?
Asked Answered
E

1

8

I am using PHP deployer 6.6.0 to deploy Laravel based websites.

Every time I deploy it creates a new release. Currently, I have more than 10 releases and it's eating up a lot of disk space.

I don't want to keep more than the last 3 releases and need the older releases to automatically roll over.

How can I specify the maximum number of releases to be kept?

Edaedacious answered 11/12, 2019 at 3:22 Comment(0)
K
10

The option you want is called keep_releases. See the docs here.

(Link points to V6 docs, since currently V7 docs fail to mention this setting. Although I see it mentioned on this upgrade guide, so I assume it still works).

By default, deployer keeps only 5 releases, so if you have more than 10 it means you changed the default configuration.

You'll probably have set('keep_releases', -1); in your configuration. Change it, so it stores only a reasonable number of releases, or delete the line directly and it will only keep 5 releases around.

set('keep_releases', 3); // e.g. for a maximum of 3 releases
Keller answered 11/12, 2019 at 8:18 Comment(4)
Please observe that the release folders in excess will be deleted immediately.Furtek
How would I set this in the YAML syntax? The documentation on it isn't great.Larcener
@HashimAziz Documentation for v7 is less complete than for v6, apparently. But here you can find an example of how to use this option on a YAML configuration.Keller
Yes, I ended up using that, and it's worth noting that as of v7 at least the default value for keep_releases is 10.Larcener

© 2022 - 2024 — McMap. All rights reserved.