Kevin Bedell
Kevin Bedell

Reputation: 13404

How do I store heroku config variables for use with foreman?

I deploy on heroku and use foreman to manage our different servers.

I have a variety of environment variables that are used on Heroko for things like S3 config parameters.

How do I configure them? I've set them manually using heroku's heroku config:set command, but foreman also supports using .env file. But if I use an `.env`` file, should I check them in? If not, how do I maintain them on heroku?

Upvotes: 0

Views: 1540

Answers (3)

oubiga
oubiga

Reputation: 193

Another good option:
Kenneth Reitz created a tool for that purpose called autoenv, and he wrote this cookbook.

Upvotes: 0

Jon Mountjoy
Jon Mountjoy

Reputation: 4526

There's also a Heroku Config plugin for the Heroku CLI that provides a way for you to push/pull your Heroku environment to use locally.

Upvotes: 1

John Beynon
John Beynon

Reputation: 37507

I would suggest adding your .env file to your .gitignore so it's not committed to git. Maybe leave a sample of it there so other devs know what they need to set when they pull the code fresh.

You can manage them via the heroku config command as you've already done or write a script that iterates your .env file and sets them on your heroku app - provided they are for the correct environment of course.

Upvotes: 1

Related Questions