I'm using Heroku, and when I display the config vars:
=== someapp-staging Config Vars
DATABASE_URL: xxx
LANG: en_US.UTF-8
NEW_RELIC_LICENSE_KEY: xxx
NEW_RELIC_LOG: stdout
RACK_ENV: staging
RAILS_ENV: staging
SENDGRID_PASSWORD: 123456
SENDGRID_USERNAME: [email protected]
WEBSOLR_URL: https://index.websolr.com/solr/0e1122334455
sendgrid_password: 654321
sendgrid_username: [email protected]
websolr_url: https://index.websolr.com/solr/0e1122334455
... some are defined more than once.
Heroku' advice is to set all vars with uppercased keys. From https://devcenter.heroku.com/articles/add-ons:
Alias names must always conform to the same naming conventions as config vars.They must begin with a letter and can only contain uppercase alphanumeric characters or underscores.
1
So... when we execute figaro heroku:set --remote staging -e staging
for example, why Figaro doesn't automatically set the keys to uppercase?
2
What to do next?
Must I set the vars in application.yml
with mixed keys like:
staging:
<<: *default
app_name: 'someapp (staging)'
SENDGRID_USERNAME: [email protected]
SENDGRID_PASSWORD: 123456
WEBSOLR_URL: 'https://index.websolr.com/solr/0e1122334455'
geocoder_api_key: 'azertyuiop123456789'
airbrake_project_id: "987654"
airbrake_project_key: 'a123456z789456123'
Thank you
ps: those are not my real credentials.
update (from laserlemon answer)
https://github.com/laserlemon/figaro/issues/238
You should write your application.yml to the exact case your application will use. While Heroku suggests a certain convention, there's no guarantee that everybody will (or can) use that convention consistently across the board. For that reason, Figaro won't automatically upcase, downcase, or otherwise. Hope that makes sense!
Best answer from Heroku: