Got an application that reads from a local config.json
file. I have two remote repos - Github and Heroku. The Github repo is public but the contents of the config file are private - therefore I've added a .gitignore
to prevent this file from being pushed.
However, when I push the app to Heroku I need the config file to be pushed so that the application can work - how do I deal with this situation?
Note: I'm reluctant to use Config vars as there are lots of settings in the config file.
Here you'll find out how to set options for heroku without commiting your config file.
https://devcenter.heroku.com/articles/config-vars
Use the Heroku CLI’s config, config:set, config:get and config:unset to manage your config vars
$ heroku config:set GITHUB_USERNAME=joesmith
Adding config vars and restarting myapp... done, v12
GITHUB_USERNAME: joesmith
$ heroku config
GITHUB_USERNAME: joesmith
OTHER_VAR: production
$ heroku config:get GITHUB_USERNAME
joesmith
$ heroku config:unset GITHUB_USERNAME
Unsetting GITHUB_USERNAME and restarting myapp... done, v13
Remember that they have limits on the size of the config file.
If you have a lot of configurations perhaps you can create a script which automates the setting of configurations?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With