-
Notifications
You must be signed in to change notification settings - Fork 17
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
Document deploying index and assets to same bucket #30
Comments
Yep, I’m having this issue too. Took me forever to diagnose. This plugin just randomly blows out other assets. Maybe I’ll open a PR... What are the advantages of using two separate buckets? That seems to be common practice, but I can’t figure out why. |
Investigated: the offending code begins in if ((data.Contents.length - this.manifestSize) > 0) {
var itemsToDelete = this._getItemsForDeletion(data);
console.log(itemsToDelete);
this._deleteItemsFromBucket(itemsToDelete)
.then(resolve)
.catch(reject);
} The implementation of The quick and dirty solution, then, is to pass
|
@andrewbranch Let me try to explain the thinking here. The The asset deployment is a dumb process- it just uploads anything new. The index upload will depend on what tools you're using. This particular plugin ( I think your confusion comes from not having a complete understanding of the role of this plugin. |
I understand that. I didn’t at first, but by the time I dove into the source and filed this issue, I had a pretty complete picture of the process. But there’s no reason for this plugin to delete things that are not index revisions. Indiscriminately deleting everything but the most recent five uploads is also a dumb process, but there’s no reason we can’t make it smarter. This would allow people to use fewer buckets on S3, if they feel like that’s a thing they should do, and wouldn’t affect the paradigmatic use case of having separate buckets. This would only make this plugin more useful. What’s the downside? |
Go for it then! I don't really have a reason not to, except that it seems wrong (to me) that the assets and index revisions would live together. That's part of the reason they're designed as separate plugins in the first place. (Also, s3 buckets are free! What's the downside of having a separate bucket?) Your change wouldn't change my workflow, so no worries! The plugin can definitely be smarter about handling the revision history. A lot of that depends on now the revisions are named, and I know there was talk about stabilizing that. There's a lot in a holding pattern as the API and workflow for ember-deploy 0.5.0 is worked out, which will introduce a new pipeline for deployment. |
I may have improperly named this issue. I don't actually care about keeping all assets in the same bucket, but I'm assuming that means as essential to the end I'm looking for. What I want:
If there might be a way to update or extend this plugin to allow serving more than just the homepage somehow (maybe through some sort of bucket-to-bucket redirect?), that would be great. I may be willing to put some time into coding/documenting a solution for that issue, but I'm not sure what an appropriate solution would look like outside of putting all those files into the root of the index bucket. |
If you're trying to solve this with an S3 only solution, here's what I would do: Upload those assets (robots.txt, favicon.ico, etc) to your asset bucket with the rest of your assets. You'll need to figure out how to set cache rules in the right manner, so you can update them as needed. Then, on your index bucket, use Routing Rules to redirect requests for That seems like it would work. Anyone else have any ideas? |
I'm trying to use ember-deploy-s3 and ember-deploy-s3-index together and I'm having trouble.
I want to host a number of files at the root of my domain: robots.txt, humans.txt, favicon.ico, opensearch.xml, etc. Instead of placing them in an
assets.mydomain.com
bucket I want to put them in mymydomain.com
bucket along with my index files. These two plugins seem to trample on each other when the same bucket is used though.I assume I am probably approaching this all wrong. What is the recommended way to host all assets out of the same bucket?
Thanks! 😄
The text was updated successfully, but these errors were encountered: