Branching: different config files for release/development

时光毁灭记忆、已成空白 提交于 2019-11-27 07:26:16
ralphtheninja

It sounds like you should read up on git attributes. Check out the section at the bottom of this page

This is helpful if a branch in your project has diverged or is specialized, but you want to be able to merge changes back in from it, and you want to ignore certain files. Say you have a database settings file called database.xml that is different in two branches, and you want to merge in your other branch without messing up the database file.

As you already said, storing the config settings inside your code isn't a good idea. Especially, your developers shouldn't even know the credentials for the production database, in my opinion.

What we do here is that on each server we have predefined environment variables pointing to a configuration file that has the necessary credentials. Since we are using Java here, this is a file like database.properties and this file is never inside a version control system.

This also makes it possible to have different settings and different credentials on each server

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!