Skip to content
Advertisement

How to set release limit while using php-deployer?

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?

Advertisement

Answer

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
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement