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?

surendar
  • 113
  • 7

1 Answers1

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
yivi
  • 42,438
  • 18
  • 116
  • 138
  • 1
    Please observe that the release folders in excess will be deleted immediately. – reim Jan 08 '22 at 08:11
  • How would I set this in the YAML syntax? The documentation on it isn't great. – Hashim Aziz Mar 28 '22 at 21:25
  • 1
    @HashimAziz Documentation for v7 is less complete than for v6, apparently. But [here](https://deployer.org/docs/7.x/UPGRADE) you can find an example of how to use this option on a YAML configuration. – yivi Mar 30 '22 at 08:47
  • 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. – Hashim Aziz Mar 30 '22 at 15:13