Reputation: 4774
I have many environment variables defined in yml file. I use this file locally for configuration. How can I set these variables on my Heroku server without adding my file to repo? My app is built on Ruby on Rails.
Upvotes: 1
Views: 487
Reputation: 8695
If you would like to reinvent the wheel… here's a kind of wheel:
heroku config:set $(cat config/application.yml | grep "^[^\#\ ].*\:\ .*$" | sed 's/\:\ /=/g' | tr "\n" " ")
It parses top-level keys of a Figaro YAML file.
Update:
You actually can use Figaro's heroku:set
to reach the same result:
$ figaro help heroku:set
Usage:
figaro heroku:set
Options:
-a, [--app=APP] # Specify a Heroku app
-e, [--environment=ENVIRONMENT] # Specify an application environment
-p, [--path=PATH] # Specify a configuration file path
# Default: config/application.yml
-r, [--remote=REMOTE] # Specify a Heroku git remote
Send Figaro configuration to Heroku
Upvotes: 1