ember-cli-deploy / ember-cli-deploy-s3-index

Ember CLI Deploy plugin to deploy ember-cli's bootstrap index file to S3.
MIT License
26 stars 52 forks source link

Use with Prember #82

Closed adambedford closed 4 years ago

adambedford commented 4 years ago

I'm trying to get this working with Prember.

Can the filePattern config option accept a regex or similar?

Currently, we're seeing this:

filePattern: '**/*.{html}'

fail with this errpr:

Error: ENOENT: no such file or directory, open 'tmp/deploy-dist/**/*.{html}'
Error: ENOENT: no such file or directory, open 'tmp/deploy-dist/**/*.{html}'
Pipeline aborted

Has anyone had experience using this plugin with Prember? I'd appreciate the help!

LevelbossMike commented 4 years ago

Hi and thanks for the issue.

I have used ember-cli-deploy with prember and ember-cli-deploy-s3 but not with ember-cli-deploy-s3-index.

To make it work you just have to extend the file-pattern that ember-cli-deploy-s3 uses to determine which files to upload.

Prember prerenders your application and creates a directory structure and html files based on your routes.

In the projects where I implemented this I used ember-cli-deploy-s3 to upload all these files to s3. The difference between the workflow that s3-index provides is that there is no notion of revisions anymore. You just deploy and you change the content of your application (the directory structure that prember creates) in place.

If you want to have some kind of revisioning of content like s3-index usually provides I am not entirely sure what would need to be done to actually achieve this but this is certainly a use case that needed to be implemented seperately from s3-index. You would need to revision the entire directory structure and switch that around when activating a revision.

Maybe you create separate folders in s3 per revision and upload the entire content into that folder and on activation you replace the entire top-layer of your folder structure in s3. This is certainly an intersting concept and a useful plugin idea but nothing that is or I want to support in this plugin - just because it's a completely different workflow of what s3-index currently provides.

Happy to help with this though. It sounds like a nice idea to be able to use s3 and revisions with prember.

adambedford commented 4 years ago

@LevelbossMike Thanks for digging into this, really is appreciated. I wasn't thinking of s3-index in the right way -- totally makes sense it doesn't play nicely with Prember in the current situation.

We switched to just using one S3 bucket for the whole app and forgoing the revision history!

Thanks again!