Start tracking and controlling changes in Drupal 8 using the core Configuration Management System. An awesome system for your and your team to work together. Discover why we got it wrong with Drupal 7, and why Drupal 8 is better at doing it. Also recommended configuration for your config files, drush commands and synchronization tools.
2. 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 …
3. Solution Architect & Consultant
Architecture and drupal development
on large projects.
4. Team continuous improvement
Part of my work I really enjoy is to help teams
being more efficient with Drupal.
Workflow
Tools
Communication
5. 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.
6. 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.
7. SCM in Drupal
Examples of configuration on Drupal:
Content type, Fields, Views, Images sizes.
Track and control changes on files,
not database.
8. 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.
9. 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.
10. Drupal 8: Modern configuration manager
Made to synchronize environments and helps to
manage complexity, paired with git.
Small, meaningful and organized files
11. 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
12. 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.
13. Configuration manager for your team
Highly recommended with the configuration
manager:
Git
Drush
Drupal configuration installer
14. 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)
15. 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.
16. 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.
17. 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
18. 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.
19. 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
20. 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
21. 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
22. 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.
23. More about Drupal 8’s SCM
Book
Drupal 8 Configuration Management
by Stefan Borchert, Anja Schirwinski
Upcoming blog post on webizat.com