19
Configuration development flow. Continuous Deployment. Profile and SQL Lviv, 2016 Drupal Cafe Andrii Podanenko

Drupal 8 configuration development flow

Embed Size (px)

Citation preview

Page 1: Drupal 8 configuration development flow

Drupal 8 Configuration development flow.

Continuous Deployment.Profile and SQL

Lviv, 2016Drupal CafeAndrii Podanenko

Page 2: Drupal 8 configuration development flow

Profile flow

When it is needed

Creating project from scratch

Working on particular module or library

Initial project development

Creating installation profile/platform

Page 3: Drupal 8 configuration development flow

Profile flow for Drupal 8

Pretty standard, similar to D7

Recipe*

1. drush site-install profile_name...

2. drush config-import or use API calls in hook_install() for specific parts

Configs can be put in

profile/config/install directory for auto importing by core or

sites/default/staging if you wish to use manual drush config-import afterwards

*(CIBox users can use sh reinstall.sh as previously)

Page 4: Drupal 8 configuration development flow

Export configs for repo for Profile flow

Export configs with blacklisted (dev modules configs shoudn’t be added to repo )

Recipe*1. drush config-export staging -y --skip-modules=devel,config_devel,stage_file_proxy

2. copy configs to $PROFILE/config/install

3. git push...

*CIBox users can use an automation script http://bit.ly/cibox_cc

Page 5: Drupal 8 configuration development flow

SQL flow

Needed for:

Project’s site needs content adding

Huge demo content needed

Complicated module’s dependencies in terms of mass content operations

SLA tasks

Page 6: Drupal 8 configuration development flow

SQL flow for Drupal 8

drush config-import won’t work!!!

Configuration Management UI as well!!!

Page 7: Drupal 8 configuration development flow

regular screen for full config import via drush for a live site

Page 8: Drupal 8 configuration development flow

Full Config Import

Page 9: Drupal 8 configuration development flow

Content Management Issue

Page 10: Drupal 8 configuration development flow

drush config-import --partialhttps://github.com/drush-ops/drush/issues/2069

Page 11: Drupal 8 configuration development flow

ConfigSubscriber

https://api.drupal.org/api/drupal/8.2.x/search/ConfigSubscriber

Page 12: Drupal 8 configuration development flow

Mismatched entity or field definition

/admin/reports/status

Page 13: Drupal 8 configuration development flow

“Easy” explanation for how-to fix

Page 14: Drupal 8 configuration development flow

Introducing config_importer service (module)

https://drupal.org/project/confi

Page 15: Drupal 8 configuration development flow

<?php/** * Enable messages block. */

function example_master_update_8077() { $path = 'sites/default/config/staging/'; \Drupal::service('config_import.importer')->importConfigs( [ $path . 'block.block.messages.yml', ] );}?>

How to use it?

Page 16: Drupal 8 configuration development flow

How to delete config*?

Just via Drupal 8 API or manually via UI

<?php/** * Enable messages block. */

function example_master_update_8078() { Drupal::configFactory()->getEditable('devel.settings')->delete();}?>

* not related to confi module

Page 17: Drupal 8 configuration development flow

How it works?

1. Active storage exported to tmp directory

2. Requested configs copied over tmp ones

3. Updated tmp directory imported back to active storage

Page 18: Drupal 8 configuration development flow

working flow with content management

Page 19: Drupal 8 configuration development flow

Thank You!

Questions?

Andrii PodanenkoTeam Lead, ArchitectFFW [email protected]