k1LoW / serverless-s3-sync

A plugin to sync local directories and S3 prefixes for Serverless Framework :zap:
183 stars 70 forks source link

Files uploaded twice with bucketPrefix #85

Closed DimiF4W closed 3 years ago

DimiF4W commented 3 years ago

Hi guys,

Im a new user of s3sync with serverless but I noticed my files are uploaded 2 times if I use bucketPrefix. My files are always uploaded in the root AND in the bucketPrefix/folder.

custom:
  s3Sync:
    - bucketNameKey: AssetBucketRef
      bucketPrefix: assets
      localDir: ./dist/
      deleteRemoved: true
      acl: public-read
      params:
        - "*.*":
            CacheControl: 'public, max-age=31536000'

This results in a /assets/xxx.json file AND a /xxx.json file. If I remove files and deleteRemoved is enabled, only the files in the bucketPrefix folder are removed, the files in the root are not removed.

Can someone check this please?

Thanks

DimiF4W commented 3 years ago

When you remove params it works as expected, so a bug I assume when using params and bucketPrefix together?

DimiF4W commented 3 years ago

Duplicate of https://github.com/k1LoW/serverless-s3-sync/issues/57