Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

double sync #57

Open
lsanders opened this issue Apr 29, 2020 · 5 comments
Open

double sync #57

lsanders opened this issue Apr 29, 2020 · 5 comments

Comments

@lsanders
Copy link

I have just a single budket/prefix defined, but end up the the files from build in both the root AND the bucketPrefix and have the following log in serverless deploy

S3 Sync: Syncing directories and S3 prefixes...
........
S3 Sync: Synced.
S3 Sync: Syncing metadata...
.
S3 Sync: Synced metadata.

Here's the relevant config:

  s3Sync:
    - bucketName: ${self:custom.siteName}
      bucketPrefix: shell/
      localDir: build
      params:
        - 'index.html':
            CacheControl: 'max-age=0,no-cache,no-store,must-revalidate'
        - 'sw.js':
            CacheControl: 'max-age=0,no-cache,no-store,must-revalidate'

This deployed via bitbucket pipelines but I don't think that matters.

@k1LoW k1LoW added the question label May 3, 2020
@nibynool
Copy link
Contributor

nibynool commented May 9, 2020

@lsanders the log you provided is showing the two steps used to sync, so that is expected.

If you've changed the bucket prefix, then the files may still be in place from a previous deploy. Can you please verify that you've deleted the files from the root and then re-sync. If the problem persists either @k1LoW or I can try to replicate it and then work out the bug.

@ciege7041
Copy link

I have the same issue as the OP.

With the below configuration I get the contents of data-files in S3 in the falcon/importer/dev/ bucket as well as the root bucket `swagger-documents.

      bucketPrefix: falcon/importer/${self:custom.myStage} 
      localDir: data-files
      deleteRemoved: false # optional, indicates whether sync deletes files no longer present in localDir. Defaults to 'true'
      params:
        - "*.json":
            CacheControl: 'public, max-age=3600'
            ContentType: 'application/json'```


However with the following configuration:
- bucketName: swagger-documents
  bucketPrefix: falcon/importer/${self:custom.myStage} 
  localDir: data-files
  deleteRemoved: false # optional, indicates whether sync deletes files no longer present in localDir. Defaults to 'true'

I only get the file in the bucketPrefix folder. 

Is this intended?

@aaronhuisinga
Copy link

aaronhuisinga commented Oct 6, 2020

@k1LoW It does indeed appear this is a real issue. If params are defined in settings, the files are uploaded to both the root and bucketPrefix directory. If I remove the params config option, the files are correctly only uploaded to the bucketPrefix directory.

@k1LoW k1LoW removed the question label Oct 7, 2020
@k1LoW
Copy link
Owner

k1LoW commented Oct 7, 2020

Thank you all !!

Now I'm lowering the development priority of this library.

If you are able to resolve this, we would encourage you to send a pull request.

@majindageta
Copy link

This looks closed by the merge of #94
(and i'm so happy my s3 bucket is so much clean)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants