Moki Environment
Categories
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Component created
Component changed
Component body
Moki Environment provides some opinionated extensions to the Environment module that allow the site administrator to automatically configure certain system settings per environment by defining php files matching the environment name in the site's configuration directory.
OK but Why?
We wanted a way to completely automate configuration management and deployment for Drupal 7. Features provided a ton, but we needed the ability to have an authoritative list of which modules should be enabled, and to have certain environment specific configuration like Solr servers and some variables. Environment provides a convenient way to define environments and act on when the environment is changed, but we quickly found we were reinventing the wheel on every project. So we abstracted out the elements that we wanted to be able to do whenever an environment switch happens.
The following components are supported:
- Authoritative list of enabled modules
- Solr environments using both Apache Solr and Search API Solr
- Variables
OK, but How do I Use it?
- Enable the module as usual
- Create files in your sites configuration directory (i.e. sites/default or sites/) to define the settings you want. These files are just normal PHP files that are automatically included if available when switching environments. The files use specific variables to collect the information required, but there are no restrictions on what you might include here.
Naming conventions available are:
- modules_baseline.inc: the default set of modules that are always enabled whenever switching environments.
- See modules_baseline.inc.example
-
modules_<environment code>.inc: included if present after modules baseline but before attempting to make the modules list match the desired state. The idea is that one might add to the list of modules here.
- See modules_env.inc.example
-
variables_default.inc: Define a default list of variables
- See variables_xxx.inc.example
-
variables_<environment code>.inc: included *instead* of the variables default, if the matching environment file is present. Note that unlike modules, it doesn't include the default set; you must define all the variables you require.
- See variables_xxx.inc.example
-
solr_default.inc/solr_<environment>.inc: allows you to define settings for the solr environment.
- see solr_xxx.inc.example
This Drupal module is created and maintained by Alloy Design + Development
