-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
There are three approaches to working with configuration management in Backdrop:
Backdrop's sites all use the Versioned Staging approach, as detailed, for example, here: https://github.com/backdrop-ops/backdropcms.org/blob/master/config/README.md
I agree that this approach, out of the three above, is the best option. However, I also believe it could use some tweaking to make it better. Here're the changes I'm proposing and their reasons/benefits:
- Rename the
live-activedirectory toactive.- Since only two directories are needed for this approach, unlike the Extra Directory approach, we can name them more simply to avoid confusion (
activeis always active andstagingis always staging). This also means thatsettings.phpwon't need to be updated between dev and live environments.
- Since only two directories are needed for this approach, unlike the Extra Directory approach, we can name them more simply to avoid confusion (
gitignoreeverything in theactivedirectory.- The very name of this approach indicates that only the
stagingdirectory is in version control, so we shouldn't be committingactiveconfig files. The reason for ignoring the files and not the wholeactivedirectory itself is that I'm hoping (this is untested) this will make it so that that cloning the repo will mean a blankactivedirectory is present and ready to use as the active directory on development environments (e.g. users don't need to perform an additional step of creating a new directory).
- The very name of this approach indicates that only the
- Remove any code/instructions that clear out the
stagingdirectory after importing toactive.- I believe I saw some code somewhere that deleted the contents of
stagingonce the import intoactivewas complete. By removing this and leavingstagingintact after import, users will get a copy of config files when cloning even though theactivedirectory is empty.
- I believe I saw some code somewhere that deleted the contents of
- Make a policy that configuration changes NEVER happen on the live site.
- When config changes happen on production, it means that someone with server access needs to go and export and commit those changes to the repo before someone cloning the repo can do any work on it. This is, at best, a bottleneck for development (requiring potential developers to find and ask an admin to do this for them) and, at worst, a barrier-to-entry for developers who find it too hard or confronting to do so (when they just want to make a simple PR but instead give up). This could open up more development opportunities for people.
- Make sure the
drushconfig commands work properly, installdrushon Backdrop's server and document that this is an option.- Typing
drush bcexis much quicker and easier (and less error-prone) than manually copying files between directories. Leave the manual instructions in-place for those who prefer them, but make thedrushcommand instructions the default.
- Typing
I think that's it for now. I'll add more if I remember anything later that I've forgotten. Feel free to give feedback, suggest alternatives, etc., all in an effort to make contributing to Backdrop's websites simpler, easier, more robust and available to more people.