Skip to content

Commit

Permalink
set the Cloudinary base folder by environment (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienpoly authored Apr 3, 2024
1 parent 6c720dd commit 6f51bdc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
end

# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local
# In development we use local storage unless teh developer has set secret keys for cloudinary
# this ensure that everyone can simply clone the repo and start working without having to setup cloudinary
# but also allows the developer to test cloudinary locally if they have the keys
config.active_storage.service = ENV["CLOUDINARY_API_SECRET"].present? ? :cloudinary : :local

# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
Expand Down
1 change: 1 addition & 0 deletions config/storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ local:

cloudinary:
service: Cloudinary
folder: <%= (ENV["IS_REVIEW_APP"] == "true") ? "review" : Rails.env %> # each environment will have its own folder in Cloudinary
# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
# amazon:
# service: S3
Expand Down
3 changes: 3 additions & 0 deletions scalingo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"env": {
"SLACK_WEBHOOK_URL": {
"value": null
},
"IS_REVIEW_APP": {
"value": "true"
}
}
}

0 comments on commit 6f51bdc

Please sign in to comment.