Skip to content
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

Allow to use a directory inside the bucket #165

Closed
fidalgo opened this issue Jun 30, 2020 · 3 comments
Closed

Allow to use a directory inside the bucket #165

fidalgo opened this issue Jun 30, 2020 · 3 comments

Comments

@fidalgo
Copy link

fidalgo commented Jun 30, 2020

I would like to have my bucket organised by the two environments:

  1. production
  2. staging

But in the configuration, I can only set the S3 bucket, not a directory. I could change in the uploaders itself but would be nice to have central place where I can configure this.

There's something I've missed from the docs?

@sorentwo
Copy link
Contributor

S3 doesn't have directories, only paths. This is something that's provided by carrierwave itself. You'll need to use a standard prefix for all of your uploaders by changing the "storage directory": https://github.com/carrierwaveuploader/carrierwave#changing-the-storage-directory

@fidalgo
Copy link
Author

fidalgo commented Jul 1, 2020

@sorentwo right, but this way I need to change store_dir and cache_dir for all the uploaders. It would be nice to have a way to specify a common path, that will come before those.
Some cases I think this is useful:

  • Having the same bucket for different services,
  • Having the same bucket for different environments (testing, staging, production, etc)

@sorentwo
Copy link
Contributor

sorentwo commented Jul 1, 2020

You can accomplish that with modules/includes within your application, at least that's how I've handled common prefixes in the past. Otherwise I suggest using separate buckets for each environment. It doesn't cost any more to have multiple buckets and you get easy environment based settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants