How to set Heroku var configuration configuration with file contents

To install the vars config for the Heroku application, you do the following:

$ heroku config:set GITHUB_USERNAME=joesmith 

How can I install config var with the contents of the file?

+15
heroku heroku-toolbelt
source share
2 answers

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

It also has a heroku config:pull command to do the opposite and works great with foreman to run the application locally using config in .env .

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

+26
source share

I know that it is too late, but still it will be useful for future users who will be here.

I also wanted a quick solution to add a variable to the heroku application, but copy-paste is so boring. Therefore, I wrote a script to read the values ​​from the .env file and install it in the requested application - all things are passed as an option:

https://gist.github.com/md-farhan-memon/e90e30cc0d67d0a0cd7779d6adfe62d1

Using
 ./bulk_add_heroku_config_variables.sh -f='/path/to/your/.environment/file' -s='bsc-server-name' -k='YOUR_CONFIG_KEY1 YOUR_CONFIG_KEY2' 
0
source share

All Articles