managing projects using drupal 8’s configuration … · 2015-08-03 · pantheon pantheon.io this...

51
PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal 8’s Configuration Management System Presented in Technicolor by Matt Cheney [email protected]

Upload: others

Post on 17-Jun-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

This session is brought to you by G0VC0N & the Drupal 8 CMS

Managing Projects Using Drupal 8’s Configuration

Management System

Presented in Technicolor by

Matt [email protected]

Page 2: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

In the beginning….

Page 3: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Page 4: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Configuration

● Content Types● Image Styles● Fields● Views● Settings

● Nodes● Users● Comments● Menu Items● Taxonomy Terms

Content

Page 5: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Page 6: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

The Problem Is That Drupal Doesn’t Care

Page 7: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

The World Until Yesterday

hook_update_n() features.module

Page 8: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Sins of the Father

● Features Module is not intended to be the solution for storing your Drupal configuration in code.

● Status as a contrib project limited its ability to be a fully integrated solution for all ones Drupal development needs.

● Variety of technical limitations around support for unique identifiers, ability to deal with state, constantly changing data structures, less than comprehensive support for contrib.

Page 9: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

“Today is a good day to start putting all of our config in code.”

\

– Greg Dunlap (rumoured) in March 2011

Page 10: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Drupal 8 CMI: Maximizing P.I.E.

● Proudly Invented Elsewhere (P.I.E.)○ Use what’s already implemented, tested, familiar○ We’re not any smarter than most people who

have worked on the problem before

● Pre-Symfony P.I.E.○ No custom format and parser (unlike .info files)○ Initially chose XML

■ Built-in parsing support■ Consistent UTF-8 for i18n support■ Support for comments

● Post-Symfony P.I.E.○ Switched to Symfony YAML parser○ Considered Config library, but no GUI support

Page 11: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Now it is YAML Time!

Page 12: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

admin/config/system/site-information

Page 13: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

system.site.yml

Page 14: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

node.type.blog.yml + field.instance.node.blog.body.yml

Page 15: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Page 16: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Page 17: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Using Configuration Management to Import a Single Config Value

(featuring the Drupal UI)

Page 18: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Configuration Manager Module (Single export)admin/config/development/configuration/single/export

Dev Site

Page 19: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

YML Filesystem.site.yml

Page 20: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Live Site

Configuration Manager Module (Single import)admin/config/development/configuration/single/import

Page 21: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Configuration Manager Module (Import confirm)admin/config/development/configuration/single/import

Live Site

Page 22: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Configuration Manager Module (Import finished)admin/config/development/configuration/single/import

Live Site

Page 23: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Using Configuration Management to Import All Config Values

(featuring the Drupal UI)

Page 24: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Configuration Manager Module (Export)admin/config/development/configuration/full/export

Dev Site

Page 25: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Downloaded Fileconfig.tar.gz

Page 26: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Configuration Manager Module (Import)admin/config/development/configuration/full/import

Live Site

Page 27: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Configuration Manager Module (Synchronize)admin/config/development/configuration

Live Site

Page 28: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Configuration Manager Module (View differences)admin/config/development/configuration

Live Site

Page 29: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Configuration Manager Module (Synchronize)admin/config/development/configuration

Live Site

Page 30: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Configuration Manager Module (Import all)admin/config/development/configuration

Live Site

Page 31: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Configuration Manager Module (Import finished)admin/config/development/configuration

Live Site

Page 32: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Where is the Configuration Management Magic?

Page 33: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

The Magic is in the Workflow

Page 34: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

The Magic is in the Workflow

Page 35: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

The Magic is in the Workflow

Page 36: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

The Magic is in the Workflow

Page 37: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

The Magic is in the Workflow

Page 38: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

The Magic is in the Workflow

Page 39: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

So Let’s Try a Live Demowith Drupal 8 Beta 12

(try it yourself at https://pantheon.io/d8)

Page 40: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Hopefully the Demo was Cool(if not blame barbarian invasions, the reliance on slave and mercenary labor, militaristic overexpansion, the rise of the influence of Byzantium, and, of course, the conference wifi)

Page 41: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Extending Drupal 8’sConfiguration Management

Page 42: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Handling Different Languages

This is how Configuration Management handles configuration values in different languages

Page 43: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Dealing with Configuration Over Multiple Git Branches & Developers is Hard!

And it requires typing lots and lots of different Drush and Git commands

Page 44: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Check out Drush’s config-merge Command

Grab Drush 8 and get started today!

Page 45: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Drupal 8’s Configuration Management is Designed to Manage a Full Site’s Config

Sharing configuration across multiple sites is not a support used case

Page 46: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Luckily there is Features for Drupal 8!

Page 47: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Learn More from Drupalcon’s Video!

Page 48: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Configuration Management Doesn’t Prevent You From Changing Config in Live

And it is important to you that all configuration be in version control and be tested before going live

Page 49: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

There is a Drupal 8 Module for that!

https://www.drupal.org/project/config_readonly

Page 50: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Let’s Talk Big PictureConfiguration Management Will Change How

Most of You Drupal on a Daily Basis

Page 51: Managing Projects Using Drupal 8’s Configuration … · 2015-08-03 · PANTHEON PANTHEON.IO This session is brought to you by G0VC0N & the Drupal 8 CMS Managing Projects Using Drupal

PANTHEON PANTHEON.IO

Thank You for Your Attention