-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Support syncing single file #29
Comments
@Horgix sorry for too late repry 🙏
I think
|
@k1LoW @Horgix I've just found myself needing this very feature, it looks like this might have been forgotten about over the last couple of years, is there any chance of seeing this come to fruition at all or if not would you be willing to share your amendments and/or publish a forked version of it @Horgix Regards Chris |
In the meantime a workaround that I have found is thus: given I only want to sync a single file (in my case in the serverless.yml file, update the custom section and the WebsiteConfiguration.IndexDocument like so: custom:
siteName: <your-site-name>
s3Sync:
- bucketName: ${self:custom.siteName}
localDir: src/
resources:
Resources:
StaticSite:
Type: AWS::S3::Bucket
Properties:
AccessControl: PublicRead
BucketName: ${self:custom.siteName}
WebsiteConfiguration:
IndexDocument: ./src/index.html |
Hey @k1LoW, Appreciate any thoughts or input. |
Feature request - Support syncing single file
Need
I would like to use this plugin to sync a single local file to an S3 bucket created by Serverless. However, this plugin only supports syncing directories, as stated in the description.
Would you be open to extending this plugin so it can also sync simple files?
Contribution
I've already modified it on my side to make it work and am wondering if I could contribute it back.
Implementation
The main question is regarding the breaking change possibility.
While it is possible to just handle single file with its path passed through the current
localDir
parameter, it isn't really logical for users to path a file to something called localDir imho.To avoid that, it would be possible to rename this field into
localPath
but it would then be a breaking change. It's also possible to introduce a new parameter calledlocalFile
which would be mutually exclusive withlocalDir
, but that adds more conditional logic to the code.What do you think about all of this? I'm ready to send a PR with whatever will be needed.
The text was updated successfully, but these errors were encountered: