Drupal 8
Configuration Management
for you and your team
About me
Luc Bezier, Drupal & Web freelance.
Founded micro company webizat in 2011.
URL: webizat.com
Worked with BBC Worldwide, UK Government agency, Ben&Jerry’s, European commission …
Solution Architect & Consultant
Architecture and drupal developmenton large projects.
Team continuous improvement
Part of my work I really enjoy is to help teams being more efficient with Drupal.
Workflow
Tools
Communication
Software Configuration Management
In software engineering, software configuration management (SCM or S/W CM) is the task of tracking and controlling changes in the software, part of the larger cross-disciplinary field of configuration management. SCM practices include revision control and the establishment of baselines.
Thanks Wikipedia.
Software Configuration Management
In software engineering, software configuration management (SCM or S/W CM) is the task of tracking and controlling changes in the software, part of the larger cross-disciplinary field of configuration management. SCM practices include revision control and the establishment of baselines.
Thanks Wikipedia.
SCM in Drupal
Examples of configuration on Drupal:Content type, Fields, Views, Images sizes.
Track and control changes on files, not database.
Deployment and synchronization
Arnold changes a field configuration,updates the configuration files,
share the changes using git.
Mary reviews and pulls the changes using git.
The client, Stephen, is very happy with the results. The changes will be deployed to production using the
new files.
No database import or export.
Drupal 7: We got it wrong
We used a contributed module called Features.
It was made to group together functionalities to answer a specific use case.
What we did with Features?We build a complex deployment system.
Drupal 8: Modern configuration manager
Made to synchronize environments and helps to manage complexity, paired with git.
Small, meaningful and organized files
Drupal 8: Modern configuration manager
Small: reduces git conflicts
Meaningful: YAML syntax
Organized: Automatically named / placed
Also ...
Automated: Imports / exports using command line
On D8 core: No extra download needed
Drupal 8: Modern configuration manager
No custom code in your configuration.
Your configuration is based on auto-generated YAML files.
You can however extend the generation of those YAML files.
Configuration manager for your team
Highly recommended with the configuration manager:
Git
Drush
Drupal configuration installer
Configuration manager for your team
Location of the configuration by default:sites/default/files/config_HASH/staging
Recommended location: outside drupal.And update your settings.php like:
$config_directories['sync'] = '../config/sync';
I would usually commit settings.php and enable the use of settings.local.php
(that one will never be on git)
Configuration manager for your team
Configuration import:$ drush cim
Configuration export:$ drush cex
Full export, then select in git which configuration files you wish to update.
Configuration manager for your team
Simple configuration & configuration entities.
Simple configuration example: system.maintenance.yml, your website
maintenance message.
Configuration entities example: core.entity_view_mode.user.full.yml,
a view configuration for the users accounts.
Configuration manager for your team
The configuration management system is meant to exist for one specific project, not shared projects.
Configuration entities have a uuid.
It means those configurations are for a particular Drupal website.
Example:uuid: 345d5f90-842c-4344-84e5-47a806a52822
Configuration manager for your team
By default, you can not import existing configurations, every installation
will generate new uuids.
Environments who do not share the same uuid, will not be able to import the configuration.
Configuration manager for your team
Solution: Configuration installer
The Configuration Installer is a installation profile that takes over the Drupal installer and allows sites to be
created from existing configuration.
drupal.org/project/config_installer
Configuration manager for your team
Solution: Configuration installer
It’s an installation profile and placed under the “profiles” directory.
Your team can now share the project’s configuration:
$ drush site-install config_installer --config-dir=../config/sync
Configuration manager for your team
Solution: Configuration installer
There is a ticket on drupal.org for this to be included in core. But it’s still a work in progress.
https://www.drupal.org/node/1613424
Configuration manager for your team
Your custom modules can for example:
Define their own configuration entity types.
Use their own yaml configuration files, inside the module’s directory.
More about Drupal 8’s SCM
BookDrupal 8 Configuration Managementby Stefan Borchert, Anja Schirwinski
Upcoming blog post on webizat.com
Thanks
Twitter @luukybemail: luc [at] webizat.com
web: webizat.com
Top Related