easy-deploy-bundle icon indicating copy to clipboard operation
easy-deploy-bundle copied to clipboard

How to handle uploads files ?

Open saperlipopette45 opened this issue 4 years ago • 1 comments

Hello, I am using easy-deploy-bundle in my project, and recently I added file upload to my website. So I store files under current/public/uploads directory. But when I deploy a new release of my projects, I loose all of the files under the current/public/uploads directory (since easydeploy creates a new one). Is there an option which handles this case ?

Thanks in advance

saperlipopette45 avatar Jun 23 '21 05:06 saperlipopette45

Hello, I am using easy-deploy-bundle in my project, and recently I added file upload to my website. So I store files under current/public/uploads directory. But when I deploy a new release of my projects, I loose all of the files under the current/public/uploads directory (since easydeploy creates a new one). Is there an option which handles this case ?

Thanks in advance

You can set it as share folder in deploy.php:

    public function configure()
    {
        return $this->getConfigBuilder()
             // ....
            ->sharedFilesAndDirs(['public/uploads'])
        ;
    }

After deploy to server, you have two choice:

  1. If your uploads folder contains lots of files, just copy your uploads folder to the shared directory created by deployer.
  2. Or create a new uploads folder in the shared directory created by deployer.

so next time you can just deploy a new release without worrying the uploads folder.

fd6130 avatar Sep 04 '21 11:09 fd6130