开发者

Using local configs in a Heroku deployment environment

开发者 https://www.devze.com 2023-01-02 11:14 出处:网络
I\'m trying to migrate my app to Heroku - I have a config file that varies with development/staging/production environments as it contains uniquely assigned keys (from Facebook, S3, etc.), so I keep i

I'm trying to migrate my app to Heroku - I have a config file that varies with development/staging/production environments as it contains uniquely assigned keys (from Facebook, S3, etc.), so I keep it out of the repository and keep the configs local.

As such I'm trying to find a solution for Heroku to have that config file since Heroku deploys from the repository. I noticed Herok开发者_高级运维u deploys from the master branch - can it deploy from another branch? Because then I could commit the Heroku configs there, and have it not overwrite the other environments' configs every time it pulls.

Thanks!


I believe Heroku always launches the master branch of the Gt repo, but they support config vars to address exactly this issue.


You can use foreman and heroku-config for this.

Check out the article at heroku dev center:

http://devcenter.heroku.com/articles/config-vars

I love this because you can keep the .env file in .gitignore and shield your production variables from ending up in the repository.

0

精彩评论

暂无评论...
验证码 换一张
取 消