How Drupal 8 Changes the Development Workflow


by:

Luis Rodriguez

I am a Developer at iterate.

Contact Me:


Presentation Slides:

http://luisrc7.github.io/dclimerick16

At iterate we design and develop Digital Experiences.

Our key focus areas are User Experience Design and Drupal.

And we are hiring!

Contact us at hello@iterate.ie or @iterate.

How Drupal 8 Changes the Development Workflow

  1. Drupal 7
  2. Drupal 8 - Configuration Management
  3. Drupal 8 CM + Drush
  4. Live Demo

Development Workflow in Drupal 7

What is configuration

  • System variables (e.g. Site Name)
  • Content Types, Fields or Views
  • Menus
  • Vocabularies

Development Workflow in Drupal 7

What is NOT configuration

  • Content: Nodes or Users
  • Comments
  • Taxonomy Terms
  • Menu Items
What is Configuration
Image Source: http://hojtsy.hu

Different Parts

  • Drupal Core (Almost all files/folders at root)
  • Websites related Files (sites and profiles folders)
  • Filesystem (sites/default/files or sites/my-site/files)
  • Database

Any configuration change will be saved into the database

But there were some workarounds.

  • Features
  • Was meant to share packages of code to different websites
  • hook_update_N
  • Others like Export/Import functions (Views, Context, Rules)

My bad experiences

  • Unsynchronised environments
  • Changes made by Clients or other developers
  • Doing configuration in Live!
  • Feature's conflicts, not working issues, overrides.

Development Workflow in Drupal 8

Configuration Management !!!

Configuration Management will save Website configuration into files

CM has an interface to import/export configuration

CM uses Yaml files

Configuration Files for Standard Profile

Yaml files from Standard Profile installation

The CMI (Configuration Manager Initiative) was the first initiative for Drupal 8 back in 2012

The UI allows Export/Import the whole site configuration

And allows you to Export/Import single configuration files

Also has a form interface to upload the code for the new configuration through the UI

CM Dependencies

CM manage dependencies

All dependencies get deleted

This allow the UI to give better information

Custom configuration files

It's possible in custom modules

But configuration files get imported just one time

To solve this issue there is "config_update" module

Then, does Features exists in Drupal 8?

Yes

Features is focused on its original purpose

Pack configuration together to share on different websites

Features will sit under the CM path

To avoid possible issues

  • Block UI changes on configuration. Module: config_readonly
  • Old way, download/sync the Live site into development before make the changes
  • With Drush

Benefits

  • Version control your configuration
  • Rollback to previous configuration
  • Create automated workflow

Unfortunately CM is not magic

Configuration still need to be imported

Configuration needs to be in the database at run time

Won't solve issues like complicated dependencies or 2 people working on the same configuration

CM + Drush Basics

Since Drush 8.x version

Basic Drush commands

drush config-export

drush config-import

Basic Drush arguments

--push | --add | --commit

--destination | --source

--partial

It's Demo Time!

Drupal 7

  • What is and what isn't configuration
  • Parts of Drupal
  • Workaround to save config in files

Drupal 8

  • Configuration Management
  • YAML files
  • Benefits
  • CM manage Dependencies
  • CM is not Magic

With Drush

  • Basic Import / Export commands
  • Basic command parameters
  • Alias combinations

Sources and Resources

  • DrupalCon presentations
  • Drupal.org Documentation
  • Reveal.js
Questions and Answers

Thank you!



Luis Rodriguez

http://luisrc7.github.io/dclimerick16