V
V
Voldemar Duletsky2012-08-30 16:31:30
git
Voldemar Duletsky, 2012-08-30 16:31:30

How to store configs in a repository?

There is a repository in which site files are stored.

A development team works with the site and it is necessary to store two versions of the configuration files - one for developers with a certain set of simple passwords and one for production with complex passwords and other logins.

We are talking about authorization settings in MySQL, remote FTP and other things.

Question - tell me how best to organize the storage of both configs for production and for developer servers.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexander Maslov, 2012-08-30
@r00t_aka_spin

I do this: the config for developers or an empty config is stored in the git repository. The production config is stored outside of git on the server. When deploying, a symlink is simply made.

Z
zibada, 2012-08-31
@zibada

Make two files - config.ext and config.local.ext, keep only the first one under version control, put the second on the ignore list.
Teach the application to read both files with settings priority from the second one.
In the second, override only locally different password type settings.
Then, when adding new settings or changing old ones, it will not be necessary to touch the “local” configs at all.

P
philpirj, 2012-08-31
@philpirj

What prevents you from using a separate repository for configs with branches for production and others, and connecting them to the main repository using git submodule? Of course, this will be handy if you are not already using the submodule, then you need to be more careful when starting git submodule update.

V
Vladimir Chernyshev, 2012-08-31
@VolCh

config.default for default settings and empty config.local for local, config.local in .gitignore. The application first reads config.default, and then overrides some settings from config.local This is if I do not use a framework in which this problem has already been solved.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question