如何在SVN中存储配置参数? [英] How to store configuration parameters in SVN?

查看:45
本文介绍了如何在SVN中存储配置参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

像许多项目一样,我们部署到许多环境,质量检查,UA,开发人员主干等.

Like many projects, we deploy to many environments, QA, UA, Developer trunks, etc..

在SVN中存储敏感配置参数的最佳方法是什么?或者,您是否应该只在服务器上保存一个包含凭证的未版本控制的较小文件呢?

What is the best way to store sensitive configuration parameters in SVN? Or, should you not and just maintain a smaller unversioned file with credentials in it on the server?

主要,我们不想向每个开发人员公开生产凭据.

Mainly, we do not want to expose production credentials to every developer.

推荐答案

我宁愿提供配置示例,而不是提供实际的配置文件.在我的项目中,根目录中有一个setup.default.php文件,每个用户都需要将该文件复制为setup.php并进行修改以匹配本地环境.另外,为了防止签回自定义的安装文件,在.svnignore中有一个规则.

I'd rather provide configuration examples than real config files. In my project there is setup.default.php file in root directory that every user need to copy as setup.php and amend to match local environment. Additionally, to prevent checking in back customised setup files there is a rule for it in .svnignore.

$ echo 'setup.php' > .svnignore
$ svn propset svn:ignore -F .svnignore .

这篇关于如何在SVN中存储配置参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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