silverstripe / sspak

Tool for managing bundles of db/assets from Silverstripe environments
http://silverstripe.github.io/sspak/
BSD 3-Clause "New" or "Revised" License
47 stars 34 forks source link

Add option to not backup assets #85

Open OldStarchy opened 2 years ago

OldStarchy commented 2 years ago

I have a number of docker containers running with a volume bound to the public/assets directory, when using sspak load it tries to move the assets to assets-old but since the directory is a volume it fails. I've had success by commenting out

https://github.com/silverstripe/sspak/blob/1d1ffff9af48b4ebd6d133830c325244e201695d/src/Webroot.php#L159

but it's a manual step I have to do every time as sspak is baked into the image and the containers are frequently rebuilt.

dhensby commented 2 years ago

Seems like it should be fairly straightforward to do. Happy to open a PR?

OldStarchy commented 2 years ago

Since raising this issue I 1. forgot I raised this issue and 2. changed our setup to not bind the assets to a docker volume. The point of the volume was to persist data between deployments but now our ci task will just create an sspak before taking down the old container and then use that to initialize the new container. As far as I'm concerned I no longer need this.

Additionally, I'm not sure that just optionally disabling this line is sufficient as just extracting the assets from the sspak would not remove any assets that are already there. (though in my case this was only used for fresh installs so it wouldn't matter anyway)