如何在不提交文件的情况下使用秘密 yaml 配置文件部署 heroku 应用程序? [英] How to deploy heroku app with secret yaml configuration file without committing the file?

查看:20
本文介绍了如何在不提交文件的情况下使用秘密 yaml 配置文件部署 heroku 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在其他 Rails 项目中,我有一个本地 database.yml,而在源代码存储库中只提交 database.sample 文件.部署时,capistrano 脚本会将 database.yml 的共享版本符号链接到所有版本.

In other rails projects, I'd have a local database.yml and in source code repository only commit the database.sample file. When deploying, a capistrano script that would symlink a shared version of database.yml to all the releases.

当部署到 heroku 时,使用了 git,它们似乎完全覆盖了 database.yml 并在内部做一些事情.

When deploying to heroku, git is used and they seem to override database.yml altogether and do something internal.

这对 database.yml 来说很好,但如果我在 config/s3.yml 中有 s3 配置怎么办.而且我将我的项目放在 github 上,所以我不想提交 s3.yml,每个人都可以看到我的凭据.它宁愿提交一个示例 s3.sample,人们将使用他们自己的设置覆盖它,并在我的工作目录中保留一个未提交的本地 s3.yml 文件.

That's all fine and good for database.yml, but what if I have s3 configurations in config/s3.yml. And I'm putting my project on github so I don't want to commit the s3.yml where everyone can see my credentials. It'd rather commit a sample s3.sample which people will override with their own settings, and keep a local s3.yml file uncommitted in my working directory.

处理此问题的最佳方法是什么?

what is the best way to handle this?

推荐答案

Heroku 对此有一些指导 -

Heroku have some guidance on this -

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

这篇关于如何在不提交文件的情况下使用秘密 yaml 配置文件部署 heroku 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆