drupal 8 configuration management for you and your team

24
Drupal 8 Configuration Management for you and your team

Upload: luc-bezier

Post on 11-Feb-2017

133 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Drupal 8 Configuration Management for you and your team

Drupal 8

Configuration Management

for you and your team

Page 2: 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 …

Page 3: Drupal 8 Configuration Management for you and your team

Solution Architect & Consultant

Architecture and drupal developmenton large projects.

Page 4: Drupal 8 Configuration Management for you and your team

Team continuous improvement

Part of my work I really enjoy is to help teams being more efficient with Drupal.

Workflow

Tools

Communication

Page 5: Drupal 8 Configuration Management for you and your team

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.

Page 6: Drupal 8 Configuration Management for you and your team

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.

Page 7: Drupal 8 Configuration Management for you and your team

SCM in Drupal

Examples of configuration on Drupal:Content type, Fields, Views, Images sizes.

Track and control changes on files, not database.

Page 8: Drupal 8 Configuration Management for you and your team

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.

Page 9: Drupal 8 Configuration Management for you and your team

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.

Page 10: Drupal 8 Configuration Management for you and your team

Drupal 8: Modern configuration manager

Made to synchronize environments and helps to manage complexity, paired with git.

Small, meaningful and organized files

Page 11: Drupal 8 Configuration Management for you and your team

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

Page 12: Drupal 8 Configuration Management for you and your team

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.

Page 13: Drupal 8 Configuration Management for you and your team

Configuration manager for your team

Highly recommended with the configuration manager:

Git

Drush

Drupal configuration installer

Page 14: Drupal 8 Configuration Management for you and your team

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)

Page 15: Drupal 8 Configuration Management for you and your team

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.

Page 16: Drupal 8 Configuration Management for you and your team

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.

Page 17: Drupal 8 Configuration Management for you and your team

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

Page 18: Drupal 8 Configuration Management for you and your team

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.

Page 19: Drupal 8 Configuration Management for you and your team

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

Page 20: Drupal 8 Configuration Management for you and your team

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

Page 21: Drupal 8 Configuration Management for you and your team

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

Page 22: Drupal 8 Configuration Management for you and your team

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.

Page 23: Drupal 8 Configuration Management for you and your team

More about Drupal 8’s SCM

BookDrupal 8 Configuration Managementby Stefan Borchert, Anja Schirwinski

Upcoming blog post on webizat.com

Page 24: Drupal 8 Configuration Management for you and your team

Thanks

Twitter @luukybemail: luc [at] webizat.com

web: webizat.com