How to set Heroku config var with contents of a file

Yarin picture Yarin · Sep 15, 2013 · Viewed 10.6k times · Source

To set config vars for a Heroku app, you do this:

$ heroku config:set GITHUB_USERNAME=joesmith

How would I set a config var with the contents of a file?

Answer

ryanbrainard picture ryanbrainard · Sep 16, 2013

Take a look at the heroku-config plugin, which adds a heroku config:push command to push key-value pairs in a file named .env to the app.

It also has a heroku config:pull command to do the opposite and works very well with foreman for running the app locally with the config in .env.

https://github.com/xavdid/heroku-config