Upload
andrii-podanenko
View
408
Download
0
Embed Size (px)
Citation preview
Drupal 8 Configuration development flow.
Continuous Deployment.Profile and SQL
Lviv, 2016Drupal CafeAndrii Podanenko
Profile flow
When it is needed
Creating project from scratch
Working on particular module or library
Initial project development
Creating installation profile/platform
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)
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
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
SQL flow for Drupal 8
drush config-import won’t work!!!
Configuration Management UI as well!!!
regular screen for full config import via drush for a live site
Full Config Import
Content Management Issue
drush config-import --partialhttps://github.com/drush-ops/drush/issues/2069
ConfigSubscriber
https://api.drupal.org/api/drupal/8.2.x/search/ConfigSubscriber
Mismatched entity or field definition
/admin/reports/status
“Easy” explanation for how-to fix
Introducing config_importer service (module)
https://drupal.org/project/confi
<?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?
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
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
working flow with content management