-
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
Support specifying a prefix path in bucket #24
Comments
Good idea. Gonna look into this. |
This would be great as well so that larger uploads wouldn't be officially rolled out until they are entirely complete. My current build has a static folder with about 4gb worth of assets so as the deploy goes out there is a good amount of time where it is not complete and the index files are referencing broken assets. With the deploy having the ability to specify a prefix path, the best use case for me would be to use it as versioning. |
@drewbietron Using this for versioning sounds interesting, but my understanding is that if a static file (e.g. an image) hasn't changed then it will have the same file name. gatsby-plugin-s3 should detect that the file already exists (and has the same checksum) and skip uploading that file. Is it uploading 4GB every time you deploy? I don't think that should happen. |
Is there any progress on getting that branch merged? I'm in need of this change 😄 |
Right now in it's current state it will overwrite the existing routing rules, so if you have multiple gatsby sites in the same bucket, it will keep overriding the most previous deployed gatsby site's redirects, so I still need to make it merge with any existing rules. You're welcome to fork the |
I've been running the branch for the past week and it seems to be working decently. I only have a single site, but I can confirm the main features of it work. I don't really have time to look into the merging of multiple sites sorry. |
If the branch seems to be working fine, when do you guys think it could get raised as a PR and be merged? |
Released in 0.3.0 |
@jariz it looks like what changed in 0.3.0 was supporting the gatsby Example use case:
Or.. the initial use case @nakedible had:
These are all independent from the gatsby prefixPath. |
Related issue: gatsby-uc#24
Related issue: gatsby-uc#24
Related issue: gatsby-uc#24
Hi, I've set the Gatsby Note: the prefix is working fine with Regards |
Echoing my man's sentiment right here. I'm having this same exact issue. I'm using 0.3.2 |
Let's reopen this because of all the reports. I'll take a closer look into this soon. |
I found a workaround for this issue that doesn't involve changing the plugin. Taking, for instance, the destination {
"deploy": "mv public public-temp && mkdir -p public && mv public-temp public/v2 && gatsby-plugin-s3 deploy --yes"
} |
The workaround in #24 (comment) may cause incorrect cache of When files are moved manually, their paths no longer match |
Is there a workaround for this? I have set:
Then run |
Another seeming inconsistency with prefixPath: https://github.com/jariz/gatsby-plugin-s3/blob/40516b39a308ccb337b853a36436beaedca86786/src/bin.ts#L196-L198 sets a non-configurable unprefixed key for My current workaround is to:
BTW is anyone already working on a fix of |
After a survey on previous work of There was a (perhaps wip) branch at https://github.com/jariz/gatsby-plugin-s3/compare/a0917f..feature//prefix authored by @jariz , but it was not merged into master. And no other commit messages mentioned "pathPrefix" "prefix" or alike. Is this branch meant for this feature? (it would take some effort to port code and resolve conflicts) |
the workaround is causing issues in case there are already other items in the s3 bucket as they get deleted |
If my thinking is correct, --prefix-paths is just a rule that actually not a folder, and then when run "gatsby-plugin-s3 deploy" it actually clear your bucket so your local public folder's content uploaded to your root bucket...... |
any new update? i am still facing the same problem :( |
Sorry for the long silence on this issue. I've looked at it several times, but the history is confusing and I haven't had the time to properly untangle it. As jokester said, jariz worked on this in the
A few notes:
|
Yep, that's what it is about. Typical use case: Stiching together documentation sites for use with the apollo docs theme. Every sub site is a distinct gatsby site, built under a distinct gatsby path prefix. To deploy all subsites to a single bucket, you also need to be able to add an S3 path prefix for uploads (the same as in the build step in this case). Btw.: This seems to work now - or do i miss something? |
Please support specifying a prefix path in the destination bucket. When using CloudFront, it is possible to serve content from a subpath in a bucket, and there are use cases that require this with direct S3 websites as well.
The same bucket might house multiple variants of the same website, or access logs, or anything else in addition to the website.
The text was updated successfully, but these errors were encountered: