-
Notifications
You must be signed in to change notification settings - Fork 109
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
Add config option bucketPrefix
for CloudFront origin path
#92
Conversation
cherry-pick from gatsby-uc#92
is there any timeframe for when this is getting merged? |
Could be useful to have it, as Gatsby added the theme concept We want to deploy Gatsby app using a common theme into multiple S3 subfolder. @jariz Any ideas why this PR is bloqued? |
I was doing some testing with this branch and I'm pretty sure that this behavior will break https://github.com/jariz/gatsby-plugin-s3/pull/92/files#diff-461a9672fe884beb7c4d6097795f4cbfR102 I suggest we change the regex to |
7c5ee10
to
4992db0
Compare
Will merge this after I tested it with the new end to end testing from @JoshuaWalsh (#83) |
I'd like to help get this merged as I'm working on a project that has one S3 bucket with two Gatsby apps in different directories inside the bucket. I found this PR and saw that it was behind master. After I rebased it and tested it locally I found that this almost worked correctly but it was creating a nameless folder and putting the bucketPrefix folder inside that. I could create a new PR that is this PR ahead of master with my change. Please let me know if this is the wrong way to contribute, or if there is an issue with the code. |
Any ETA on when this can be merged. We are in need of this feature. |
Any news on this feature? Will it be merged sometime soon? |
For people who are wanting to use this feature in order to serve multiple websites from the same bucket, perhaps consider using separate buckets for each Gatsby site? You won't be charged more (S3 charges based on storage space used and data in/out) and you will be able to use the nice "website configuration" features of S3. Another reason you might be wanting to put them in the same website is to serve different Gatsby apps at different paths of your website - if this is the case, you could still use separate S3 buckets and a CloudFront distribution with different origins configured. I could be missing something, but I don't think this feature needs to be a dealbreaker for any the scenario I can think of. Hope this helps! |
@thomaslefeuvre my scenario (and likely others here) is two Gatsby apps that operate under different subdirectories of the same URL. The cloudfront/s3 architecture is tied together at the domain name, so both apps need to be in the same bucket. |
Continues in #134 |
This is related to #24
Specifically, this adds support for an optional
bucketPrefix
option to be used for uploading the build into a directory in the S3 bucket. This is different thanpathPrefix
which is related to the actual build content and linking of pages therein.In practical terms, this would relate to the directory path/origin path option in CloudFront.
More info here: https://aws.amazon.com/about-aws/whats-new/2014/12/16/amazon-cloudfront-now-allows-directory-path-as-origin-name/