SlideShare une entreprise Scribd logo
1  sur  61
Télécharger pour lire hors ligne
Advanced Configuration Management
with Config Split et al.
Fabian Bircher
fabian@nuvole.org
web: nuvole.org       twitter: @nuvoleweb
👍
Our Clients
International organisations
Institutions
Fast delivery: several developers working simultaneously on the
same project
Frequent configuration changes: need for safe updates
Chapter 1
➡
Can I deploy con guration?
Can I develop/test configuration on a development copy and keep
the production site online all the time?
Can I export configuration changes from development and import
them into production?
➡ Chapter 1: Can I deploy configuration?
⚙
Con guration Management
One of the most important improvements in Drupal 8.
A new and complete solution to an ancient problem.
Reference use case: export the configuration changes from
development and import them into production.
➡ Chapter 1: Can I deploy configuration?
🎬 The reference use case: step 1 of 6
Clone Site to Dev
Production
Install Site
Make a full backup
Database
Files
Development
Clone production site by
restoring the backup
...or the other way round.
➡ Chapter 1: Can I deploy configuration?
🎬 The reference use case: step 2 of 6
Modify Con guration
Production
Site operates normally:
new users.
new content.
Development
Configuration changes...
➡ Chapter 1: Can I deploy configuration?
🎬 The reference use case: step 3 of 6
Export Con guration
Production
Site operates normally:
new users.
new content.
Development
Then
$ drush cex
Collection Config
system.site update
The .yml files in your export
directory (config/sync) will
be deleted and replaced with
the active config. (y/n): y
$ git commit && git push
➡ Chapter 1: Can I deploy configuration?
🎬 The reference use case: step 4 of 6
Stage Con guration
Production
$ git pull
Development
Development goes on normally.
➡ Chapter 1: Can I deploy configuration?
🎬 The reference use case: step 5 of 6
Review Changes
Production
$ drush config-import 
--preview=diff
...
uuid: d1329a45-acab-4599...
-name: 'localhost'
+name: 'Drupal 8'
mail: info@example.com
slogan: ''
page:
Import changes? (y/n):
Development
Development goes on normally.
➡ Chapter 1: Can I deploy configuration?
🎬 The reference use case: step 6 of 6
Apply Changes
Production
$ drush cim
Collection Config
system.site update
Import changes? (y/n): y
Development
Development goes on normally.
➡ Chapter 1: Can I deploy configuration?
🚚
Production deployment
Pull code and configuration from master branch.
Run updates: $ drush updatedb
Import configuration: $ drush cim
Important: the order must be respected. Issue will
enforce it.
#2628144
➡ Chapter 1: Can I deploy configuration?
❓
Problem solved?
Configuration Management works perfectly for its use case.
But the reference use case scenario is very narrow.
In real life we need to cover many more scenarios.
...And weren't we supposed to get rid of database dumps, by the
way?
Chapter 2
🎁
Can I install a site from existing
con guration?
🎁 Chapter 2: Can I install a site from existing configuration?

Bootstrapping production
Deployment is nice but how do get production up and running for
the first time?
Did you say database dump? 🚽   
🎁 Chapter 2: Can I install a site from existing configuration?
🎁
Con guration Installer
Usually running the installer creates a "new site".
The Configuration Installer is an installation profile that takes over
the Drupal installer and allows sites to be created from existing
configuration.
It is an installation profile and needs to be put in /profiles in
order to work.
Should be on every site (and in core)
🎁 Chapter 2: Can I install a site from existing configuration?
🎁
Con guration Installer UI
🎁 Chapter 2: Can I install a site from existing configuration?
🎁
Con guration Installer in core
Allow a site to be installed from existing configuration:
https://www.drupal.org/node/1613424
Chapter 3

Can I override local
con guration?
Can I have verbose error logging enabled on the development
copy only?
Can I customize API keys in production without committing them?
 Chapter 3: Can I override local configuration?
📝
Overriding
In development, it is convenient to have a different configuration
than on the production site.
Examples: different error reporting, different API keys for services,
different site name or site mail.
These customizations are not to be exported.
Not covered by the reference use case.
 Chapter 3: Can I override local configuration?
📝
Using $config
The $config array allows run-time overriding: configuration is still
there, but it gets overridden.
Example: add to settings.php (or settings.local.php)
in the development enviroment:
$config['system.logging']['error_level'] = 'verbose';
This enables verbose error logging on that instance.
 Chapter 3: Can I override local configuration?
📝
$config and editing
Even after the override admin/config/development/logging shows the
original (non-overridden) settings. This is wanted: Drupal prevents
you from submitting overridden configuration.
 Chapter 3: Can I override local configuration?
📝
$config and exporting
Even after the override, $ drush cex exports the original settings.
This is wanted too: Drupal will not let the override slip into the
export.
 Chapter 3: Can I override local configuration?
⚙
Mutable and immutable
con guration
Drupal can retrieve configuration as mutable or immutable.
Immutable
Retrieved in read-only mode (to apply/display; overrides
are considered)
Drupal::config('system.site');
Mutable
Retrieved in read-write mode (to set/export values;
overrides are ignored)
Drupal::configFactory()
->getEditable('system.site');
 Chapter 3: Can I override local configuration?
🔍
Finding keys and values:
mapping
Keys/values for $config are mapped from the YAML files.
--- a/sync/system.logging.yml
+++ b/sync/system.logging.yml
@@ -1,3 +1,3 @@
-error_level: hide
+error_level: verbose
_core:
default_config_hash: u3-njszl92FaxjrCMiq0yDcjAfcdx72
becomes:
$config['system.logging']['error_level'] = 'verbose';
 Chapter 3: Can I override local configuration?
📝
A satisfactory solution?
$config covers our need for differentiating configuration between
environments but...
You can only alter existing configuration.
You can't add new configuration using $config
You can't completely "unset" existing configuration using $config
You can't override which modules are installed.
You can't override the color of Bartik and other details.
The contrib module has the same limitations. But it
is great for run-time overriding configuration from modules.
Config overrride
Chapter 4
🚫
Can I exclude modules from
getting deployed?
Can I have development modules enabled on a development
environment but not deploy them to the production site?
🚫 Chapter 4: Can I exclude modules from getting deployed?
✂
Con guration split
Configuration override not at runtime but at import/export time.
Split off some configuration to dedicated folder.
Break up the monolithic configuration.
Blacklist configuration.
Specify set of configuration with wildcards.
Configured by configuration entities.
Works with drush >8.1.10
drush config-export
drush config-import
🚫 Chapter 4: Can I exclude modules from getting deployed?
✂
Con guration split
🚫 Chapter 4: Can I exclude modules from getting deployed?
✂
Con guration split
Split off only config which is different from the default and leave
the original one in place. → Graylist.
Import or export only the config which is split off.
drush config-split-export dev
drush config-split-import dev
Decide which split configuration to use per environment.
$config['config_split.config_split.dev']['status'] = TRUE;
🚫 Chapter 4: Can I exclude modules from getting deployed?
✂
Con g split et. al.
Depends on which provides a ConfigFilter plugin.
Swaps cores sync storage → Works with default drush commands.
Wait to get mature in contrib (96 sites 0 bugs so far)
... and then move to core.
Config Filter
🚫 Chapter 4: Can I exclude modules from getting deployed?

Other Methods
drush: Drush used to have --skip-modules but it didn't work well.
Basic concept is moved to and is removed from drush!Config Filter
PR#2684
drush_cmi_tools: https://github.com/previousnext/drush_cmi_tools
Operates with a list of configuration to ignore, own drush
commands.
Chapter 5
 👽 👻
Can I work in parallel with a
colleague?
Can two or more developers work simultaneously on the same
project?
How do I ensure that my work is not lost?
Can I assume that Git will always do the right thing when
merging?
 👽 👻 Chapter 5: Can I work in parallel with a colleague?
Git to the rescue
Configuration Management is designed to share configuration
between different environments.
Configuration is exported to text files.
And for text files we have Git!
 👽 👻 Chapter 5: Can I work in parallel with a colleague?
Working as a
 👽 👻
Team of developers
Share a Git repository for both code and configuration.
Install site starting from initial configuration.
Adopt “A successful Git branching model” (cit.)
 👽 👻 Chapter 5: Can I work in parallel with a colleague?
 👽 👻
Project bootstrap

First developer:
Initialise repository.
Installs site locally.
Exports configuration to sync.
Commits and pushes to shared
Git repository.
👽 👻
Other developers (and prod):
Clone code.
Have config_installer profile
available.
Install site starting from
exported configuration.
 👽 👻 Chapter 5: Can I work in parallel with a colleague?
 👽 👻
Parallel development

First developer:
Own branch:
checkout -b feature-a
(code, code, code...)
Commits and pushes to shared
Git repository.
👽 👻
Other developer(s):
Own branch:
checkout -b feature-b
(code, code, code...)
Commit and push to shared Git
repository.
...but careless merge is dangerous and problematic.
 👽 👻 Chapter 5: Can I work in parallel with a colleague?
Collaboration issues
A careless workflow may result in:
Losing all uncommitted work.
Accidentally overwrite work by others.
A configuration that looks OK at first sight but that is actually
invalid for Drupal.
 👽 👻 Chapter 5: Can I work in parallel with a colleague?
📦
The safe sequence for sharing
1. Export configuration: drush cex
2. Commit
3. Merge: git pull
4. Update dependencies: composer install
5. Run updates: drush updb
6. Import configuration: drush cim
7. Push: git push
 👽 👻 Chapter 5: Can I work in parallel with a colleague?
📦
If you do it wrong...
Import before Export: Deletes your work, no backup.
Merge before Export: Export deletes previous work, solved by git.
No updb or after cim, will be disallowed, database might be
broken.
No composer install, may not have all the updated code.
Merge before Commit: Manual labour on conflicts.
Forgotten Import: Next export will not contain merged config,
more difficult to solve in git.
 👽 👻 Chapter 5: Can I work in parallel with a colleague?
📦
The safe sequence for updating
1. Update code: composer update
2. Run updates: drush updb
3. Export updated config: drush cex
4. Commit
5. Push: git push
 👽 👻 Chapter 5: Can I work in parallel with a colleague?
Breaking con guration with Git
Setup: Installed standard profile
Developer A on branch feature-a deletes Tags from 'Article'.
Resulting configuration change: 2 files are removed (field
instance and field storage)
Developer B on branch feature-b adds Tags to 'Basic page'.
Resulting configuration change: 1 file is added (field instance)
Git will happily merge feature-a and feature-b into develop
The resulting configuration is invalid:
Tags has a field instance but no storage.
Takeaway: when merging check that the configuration is still valid by
importing it.
Chapter 6
☢
Can I handle a client messing
with production con guration?
☢ Chapter 6: Can I handle a client messing with production configuration?
💀
Changes on production
Imagine the ideal situation:
Configuration is correctly exported, versioned and deployed
Development team adopts a solid GIT branching model
BUT...
Configuration on production is changed
by your Geeky Client™ overnight, without notice.
☢ Chapter 6: Can I handle a client messing with production configuration?
🔒
Option 1
Lock con guration on
production
Don’t allow config changes on the production site if ever possible by
installing the config_readonly module.
Note: add this to settings.php in production:
$settings['config_readonly'] = TRUE;
☢ Chapter 6: Can I handle a client messing with production configuration?
☢
Option 2
Export to a dedicated branch
Have a person responsible for merging prod and dev configuration.
☢ Chapter 6: Can I handle a client messing with production configuration?
✂
Option 3
Con guration split
Review changes done by the client on production and choose
what to keep → graylist.
Export production changes via drush config-split-export to
../config/client
Pull new configuration: business as usual
Deploy configuration changes via drush cim: business as usual
Configuration is imported from both ../config/sync and
../config/client
Chapter 7

Can I package con guration and
re-use it?
 Chapter 7: Can I package configuration and re-use it?
📦  
Features for Drupal 8
The Features module: a configuration packager.
Entirely new for Drupal 8, to take advantage of Configuration
Management.
Offers automatic packaging: Features analyzes your site and
automatically packages up site configuration into a set of features.
 Chapter 7: Can I package configuration and re-use it?
📦  
Features for Drupal 8
Focuses on packaging configuration for reuse purpose only.
Is meant to be a development module: generated features do not
depend on the Features module.
The resulting features are modules: just enable to activate their
configuration.
 Chapter 7: Can I package configuration and re-use it?
📦  
Using Features
Enable the Features module - only in development, not needed in
production.
Enable the dedicated Features UI module too.
Generate the Features at admin/config/development/features
Enable the Features modules you generated; these are portable
between sites.
 Chapter 7: Can I package configuration and re-use it?
📦  
Features work ow
If you use Features 8.x for deployment: You are doing it wrong.™
Re-use partial configuration between different sites.
Use Features in development environments only.
Use for distributions rather than individual projects.
Chapter 8

Can I deploy the content
my con guration depends upon?
What about a view that depends on a taxonomy term?
Can I have default content on my site?
Can I change content with my deployment?
 Chapter 8: Can I deploy the content my configuration depends upon?

Deploying content
Scenario: Deploying configuration that depends on content such
as nodes, blocks, taxonomy terms, etc.
Problem: Content is not exported along with configuration.
 Chapter 8: Can I deploy the content my configuration depends upon?

Option 1
Handle missing content event
When content required by configuration is missing Drupal fires a
ConfigEvents::IMPORT_MISSING_CONTENT event.
You could subscribe to that event via an event subscriber and, for
example, perform a run-time migration using Migrate (now in core).
If nothing happens Drupal will handle it for you on
DrupalCoreConfigImporterFinalMissingContentSubscriber
which will just remove content dependencies, run-time.
 Chapter 8: Can I deploy the content my configuration depends upon?

Option 2
Use default_content module
Any module that requires default content can provide hal+json
versions of the entities inside
{module_name}/content/{entity_type} folders.
Entity references are respected by Drupal 8 core thanks to the
HAL core module and content entities having UUID by default.
Content is imported when the module is installed.
 Chapter 8: Can I deploy the content my configuration depends upon?

Option 3
Use deploy
From the module's page at https://www.drupal.org/project/deploy
The Deploy module is designed to allow users
to easily stage and preview content for a Drupal site.
 Chapter 8: Can I deploy the content my configuration depends upon?

Working with content updates
In Drupal 8 there is a post update hook
specifically designed to work with content.
function hook_post_update_NAME(&$sandbox) { }
New with proof of concept module :Config Import N
function hook_pre_config_import_NAME(&$sandbox) { }
function hook_post_config_import_NAME(&$sandbox) { }

Related contrib projects
config_installer install site from existing config.
config_filter filter config at import/export time.
config_split import time config override.
config_readonly locks any configuration changes via UI.
config_override help with run-time config override.
config_tools automatically commit config changes to git.

Related contrib projects
config_devel module helps with developing configuration.
config_update report changes between original and active config
of a module.
features bundle config for re-use on different site, ideal for
distributions.
config_sync provides methods for safely importing site
configuration from updated modules and themes.
config_ignore remove config from config management.
THANKS!

Contenu connexe

Tendances

Drupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentDrupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentsparkfabrik
 
Drupal 8: frontend development
Drupal 8: frontend developmentDrupal 8: frontend development
Drupal 8: frontend developmentsparkfabrik
 
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017Jeff Geerling
 
11 tools for your PHP devops stack
11 tools for your PHP devops stack11 tools for your PHP devops stack
11 tools for your PHP devops stackKris Buytaert
 
Improving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAImproving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAJesus Manuel Olivas
 
Composer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.pptComposer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.pptPromet Source
 
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...Acquia
 
Introduction to Composer for Drupal
Introduction to Composer for DrupalIntroduction to Composer for Drupal
Introduction to Composer for DrupalLuc Bézier
 
Drupal 8 Configuration Management for you and your team
Drupal 8 Configuration Management for you and your teamDrupal 8 Configuration Management for you and your team
Drupal 8 Configuration Management for you and your teamLuc Bézier
 
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...Phase2
 
Drupal VM for Drupal 8 Dev - MidCamp 2017
Drupal VM for Drupal 8 Dev - MidCamp 2017Drupal VM for Drupal 8 Dev - MidCamp 2017
Drupal VM for Drupal 8 Dev - MidCamp 2017Jeff Geerling
 
Drupal 8 Every Day: An Intro to Developing With Drupal 8
Drupal 8 Every Day: An Intro to Developing With Drupal 8Drupal 8 Every Day: An Intro to Developing With Drupal 8
Drupal 8 Every Day: An Intro to Developing With Drupal 8Acquia
 
Keeping Local, Staging & Production Sites In Sync
Keeping Local, Staging & Production Sites In SyncKeeping Local, Staging & Production Sites In Sync
Keeping Local, Staging & Production Sites In SyncDavid Wang
 
Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesdrupalindia
 
Introducing DeploYii 0.5
Introducing DeploYii 0.5Introducing DeploYii 0.5
Introducing DeploYii 0.5Giovanni Derks
 
Introduction to Webpack - Ordina JWorks - CC JS & Web
Introduction to Webpack - Ordina JWorks - CC JS & WebIntroduction to Webpack - Ordina JWorks - CC JS & Web
Introduction to Webpack - Ordina JWorks - CC JS & WebJWORKS powered by Ordina
 
Voiture tech talk
Voiture tech talkVoiture tech talk
Voiture tech talkHoppinger
 

Tendances (20)

Drupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentDrupal 8 - Corso frontend development
Drupal 8 - Corso frontend development
 
Drupal 8: frontend development
Drupal 8: frontend developmentDrupal 8: frontend development
Drupal 8: frontend development
 
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
 
11 tools for your PHP devops stack
11 tools for your PHP devops stack11 tools for your PHP devops stack
11 tools for your PHP devops stack
 
Improving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAImproving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLA
 
Composer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.pptComposer tools and frameworks for drupal.ppt
Composer tools and frameworks for drupal.ppt
 
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
 
Introduction to Composer for Drupal
Introduction to Composer for DrupalIntroduction to Composer for Drupal
Introduction to Composer for Drupal
 
Drupal 8 Configuration Management for you and your team
Drupal 8 Configuration Management for you and your teamDrupal 8 Configuration Management for you and your team
Drupal 8 Configuration Management for you and your team
 
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
 
Drupal VM for Drupal 8 Dev - MidCamp 2017
Drupal VM for Drupal 8 Dev - MidCamp 2017Drupal VM for Drupal 8 Dev - MidCamp 2017
Drupal VM for Drupal 8 Dev - MidCamp 2017
 
Drupal 8 Every Day: An Intro to Developing With Drupal 8
Drupal 8 Every Day: An Intro to Developing With Drupal 8Drupal 8 Every Day: An Intro to Developing With Drupal 8
Drupal 8 Every Day: An Intro to Developing With Drupal 8
 
Keeping Local, Staging & Production Sites In Sync
Keeping Local, Staging & Production Sites In SyncKeeping Local, Staging & Production Sites In Sync
Keeping Local, Staging & Production Sites In Sync
 
CakePHP
CakePHPCakePHP
CakePHP
 
Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sites
 
Introducing DeploYii 0.5
Introducing DeploYii 0.5Introducing DeploYii 0.5
Introducing DeploYii 0.5
 
Introduction to Webpack - Ordina JWorks - CC JS & Web
Introduction to Webpack - Ordina JWorks - CC JS & WebIntroduction to Webpack - Ordina JWorks - CC JS & Web
Introduction to Webpack - Ordina JWorks - CC JS & Web
 
Apache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolboxApache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolbox
 
TibcoBW6.0
TibcoBW6.0TibcoBW6.0
TibcoBW6.0
 
Voiture tech talk
Voiture tech talkVoiture tech talk
Voiture tech talk
 

Similaire à Advanced Configuration Management with Config Split et al.

Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...Erich Beyrent
 
Magento Docker Setup.pdf
Magento Docker Setup.pdfMagento Docker Setup.pdf
Magento Docker Setup.pdfAbid Malik
 
DDAY2014 - Features per Drupal 8
DDAY2014 - Features per Drupal 8DDAY2014 - Features per Drupal 8
DDAY2014 - Features per Drupal 8DrupalDay
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned RightScale
 
Development Setup of B-Translator
Development Setup of B-TranslatorDevelopment Setup of B-Translator
Development Setup of B-TranslatorDashamir Hoxha
 
CMI 2.0 session at Drupal DevDays in Cluj-Napoca
CMI 2.0 session at Drupal DevDays in Cluj-NapocaCMI 2.0 session at Drupal DevDays in Cluj-Napoca
CMI 2.0 session at Drupal DevDays in Cluj-NapocaNuvole
 
Trunk based development
Trunk based developmentTrunk based development
Trunk based developmentgo_oh
 
Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...Aleksey Tkachenko
 
Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...
Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...
Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...hamidsamadi
 
November 15 cloud bees clusterhq meetup fli, flockerhub, and jenkins
November 15 cloud bees clusterhq meetup   fli, flockerhub, and jenkinsNovember 15 cloud bees clusterhq meetup   fli, flockerhub, and jenkins
November 15 cloud bees clusterhq meetup fli, flockerhub, and jenkinsRyan Wallner
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Mack Hardy
 
Gitlab ci e kubernetes, build test and deploy your projects like a pro
Gitlab ci e kubernetes, build test and deploy your projects like a proGitlab ci e kubernetes, build test and deploy your projects like a pro
Gitlab ci e kubernetes, build test and deploy your projects like a prosparkfabrik
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushPantheon
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins UsersAndrew Bayer
 
Getting Into Drupal 8 Configuration
Getting Into Drupal 8 ConfigurationGetting Into Drupal 8 Configuration
Getting Into Drupal 8 ConfigurationPhilip Norton
 
[20200720]cloud native develoment - Nelson Lin
[20200720]cloud native develoment - Nelson Lin[20200720]cloud native develoment - Nelson Lin
[20200720]cloud native develoment - Nelson LinHanLing Shen
 

Similaire à Advanced Configuration Management with Config Split et al. (20)

Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
 
Magento Docker Setup.pdf
Magento Docker Setup.pdfMagento Docker Setup.pdf
Magento Docker Setup.pdf
 
Gitops Hands On
Gitops Hands OnGitops Hands On
Gitops Hands On
 
DDAY2014 - Features per Drupal 8
DDAY2014 - Features per Drupal 8DDAY2014 - Features per Drupal 8
DDAY2014 - Features per Drupal 8
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
 
Development Setup of B-Translator
Development Setup of B-TranslatorDevelopment Setup of B-Translator
Development Setup of B-Translator
 
Introduction to Git (part 3)
Introduction to Git (part 3)Introduction to Git (part 3)
Introduction to Git (part 3)
 
CMI 2.0 session at Drupal DevDays in Cluj-Napoca
CMI 2.0 session at Drupal DevDays in Cluj-NapocaCMI 2.0 session at Drupal DevDays in Cluj-Napoca
CMI 2.0 session at Drupal DevDays in Cluj-Napoca
 
CodeShip
CodeShipCodeShip
CodeShip
 
Trunk based development
Trunk based developmentTrunk based development
Trunk based development
 
Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...
 
Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...
Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...
Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...
 
An intro to git
An intro to gitAn intro to git
An intro to git
 
November 15 cloud bees clusterhq meetup fli, flockerhub, and jenkins
November 15 cloud bees clusterhq meetup   fli, flockerhub, and jenkinsNovember 15 cloud bees clusterhq meetup   fli, flockerhub, and jenkins
November 15 cloud bees clusterhq meetup fli, flockerhub, and jenkins
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
 
Gitlab ci e kubernetes, build test and deploy your projects like a pro
Gitlab ci e kubernetes, build test and deploy your projects like a proGitlab ci e kubernetes, build test and deploy your projects like a pro
Gitlab ci e kubernetes, build test and deploy your projects like a pro
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and Drush
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
 
Getting Into Drupal 8 Configuration
Getting Into Drupal 8 ConfigurationGetting Into Drupal 8 Configuration
Getting Into Drupal 8 Configuration
 
[20200720]cloud native develoment - Nelson Lin
[20200720]cloud native develoment - Nelson Lin[20200720]cloud native develoment - Nelson Lin
[20200720]cloud native develoment - Nelson Lin
 

Plus de Nuvole

The OpenEuropa Initiative
The OpenEuropa InitiativeThe OpenEuropa Initiative
The OpenEuropa InitiativeNuvole
 
Introducing the UI Patterns module: use atomic UI components everywhere in Dr...
Introducing the UI Patterns module: use atomic UI components everywhere in Dr...Introducing the UI Patterns module: use atomic UI components everywhere in Dr...
Introducing the UI Patterns module: use atomic UI components everywhere in Dr...Nuvole
 
Remote Collaboration and Institutional Intranets with Drupal and Open Atrium
Remote Collaboration and Institutional Intranets with Drupal and Open AtriumRemote Collaboration and Institutional Intranets with Drupal and Open Atrium
Remote Collaboration and Institutional Intranets with Drupal and Open AtriumNuvole
 
Public Works Monitoring
Public Works MonitoringPublic Works Monitoring
Public Works MonitoringNuvole
 
Extending and Customizing Open Atrium
Extending and Customizing Open AtriumExtending and Customizing Open Atrium
Extending and Customizing Open AtriumNuvole
 
Code driven development: using Features effectively in Drupal 6 and 7
Code driven development: using Features effectively in Drupal 6 and 7Code driven development: using Features effectively in Drupal 6 and 7
Code driven development: using Features effectively in Drupal 6 and 7Nuvole
 
Features based development workflow
Features based development workflowFeatures based development workflow
Features based development workflowNuvole
 
First Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentFirst Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentNuvole
 

Plus de Nuvole (8)

The OpenEuropa Initiative
The OpenEuropa InitiativeThe OpenEuropa Initiative
The OpenEuropa Initiative
 
Introducing the UI Patterns module: use atomic UI components everywhere in Dr...
Introducing the UI Patterns module: use atomic UI components everywhere in Dr...Introducing the UI Patterns module: use atomic UI components everywhere in Dr...
Introducing the UI Patterns module: use atomic UI components everywhere in Dr...
 
Remote Collaboration and Institutional Intranets with Drupal and Open Atrium
Remote Collaboration and Institutional Intranets with Drupal and Open AtriumRemote Collaboration and Institutional Intranets with Drupal and Open Atrium
Remote Collaboration and Institutional Intranets with Drupal and Open Atrium
 
Public Works Monitoring
Public Works MonitoringPublic Works Monitoring
Public Works Monitoring
 
Extending and Customizing Open Atrium
Extending and Customizing Open AtriumExtending and Customizing Open Atrium
Extending and Customizing Open Atrium
 
Code driven development: using Features effectively in Drupal 6 and 7
Code driven development: using Features effectively in Drupal 6 and 7Code driven development: using Features effectively in Drupal 6 and 7
Code driven development: using Features effectively in Drupal 6 and 7
 
Features based development workflow
Features based development workflowFeatures based development workflow
Features based development workflow
 
First Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentFirst Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven Development
 

Dernier

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 

Dernier (20)

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 

Advanced Configuration Management with Config Split et al.

  • 1. Advanced Configuration Management with Config Split et al. Fabian Bircher fabian@nuvole.org web: nuvole.org       twitter: @nuvoleweb
  • 2. 👍 Our Clients International organisations Institutions Fast delivery: several developers working simultaneously on the same project Frequent configuration changes: need for safe updates
  • 3. Chapter 1 ➡ Can I deploy con guration? Can I develop/test configuration on a development copy and keep the production site online all the time? Can I export configuration changes from development and import them into production?
  • 4. ➡ Chapter 1: Can I deploy configuration? ⚙ Con guration Management One of the most important improvements in Drupal 8. A new and complete solution to an ancient problem. Reference use case: export the configuration changes from development and import them into production.
  • 5. ➡ Chapter 1: Can I deploy configuration? 🎬 The reference use case: step 1 of 6 Clone Site to Dev Production Install Site Make a full backup Database Files Development Clone production site by restoring the backup ...or the other way round.
  • 6. ➡ Chapter 1: Can I deploy configuration? 🎬 The reference use case: step 2 of 6 Modify Con guration Production Site operates normally: new users. new content. Development Configuration changes...
  • 7. ➡ Chapter 1: Can I deploy configuration? 🎬 The reference use case: step 3 of 6 Export Con guration Production Site operates normally: new users. new content. Development Then $ drush cex Collection Config system.site update The .yml files in your export directory (config/sync) will be deleted and replaced with the active config. (y/n): y $ git commit && git push
  • 8. ➡ Chapter 1: Can I deploy configuration? 🎬 The reference use case: step 4 of 6 Stage Con guration Production $ git pull Development Development goes on normally.
  • 9. ➡ Chapter 1: Can I deploy configuration? 🎬 The reference use case: step 5 of 6 Review Changes Production $ drush config-import --preview=diff ... uuid: d1329a45-acab-4599... -name: 'localhost' +name: 'Drupal 8' mail: info@example.com slogan: '' page: Import changes? (y/n): Development Development goes on normally.
  • 10. ➡ Chapter 1: Can I deploy configuration? 🎬 The reference use case: step 6 of 6 Apply Changes Production $ drush cim Collection Config system.site update Import changes? (y/n): y Development Development goes on normally.
  • 11. ➡ Chapter 1: Can I deploy configuration? 🚚 Production deployment Pull code and configuration from master branch. Run updates: $ drush updatedb Import configuration: $ drush cim Important: the order must be respected. Issue will enforce it. #2628144
  • 12. ➡ Chapter 1: Can I deploy configuration? ❓ Problem solved? Configuration Management works perfectly for its use case. But the reference use case scenario is very narrow. In real life we need to cover many more scenarios. ...And weren't we supposed to get rid of database dumps, by the way?
  • 13. Chapter 2 🎁 Can I install a site from existing con guration?
  • 14. 🎁 Chapter 2: Can I install a site from existing configuration?  Bootstrapping production Deployment is nice but how do get production up and running for the first time? Did you say database dump? 🚽   
  • 15. 🎁 Chapter 2: Can I install a site from existing configuration? 🎁 Con guration Installer Usually running the installer creates a "new site". The Configuration Installer is an installation profile that takes over the Drupal installer and allows sites to be created from existing configuration. It is an installation profile and needs to be put in /profiles in order to work. Should be on every site (and in core)
  • 16. 🎁 Chapter 2: Can I install a site from existing configuration? 🎁 Con guration Installer UI
  • 17. 🎁 Chapter 2: Can I install a site from existing configuration? 🎁 Con guration Installer in core Allow a site to be installed from existing configuration: https://www.drupal.org/node/1613424
  • 18. Chapter 3  Can I override local con guration? Can I have verbose error logging enabled on the development copy only? Can I customize API keys in production without committing them?
  • 19.  Chapter 3: Can I override local configuration? 📝 Overriding In development, it is convenient to have a different configuration than on the production site. Examples: different error reporting, different API keys for services, different site name or site mail. These customizations are not to be exported. Not covered by the reference use case.
  • 20.  Chapter 3: Can I override local configuration? 📝 Using $config The $config array allows run-time overriding: configuration is still there, but it gets overridden. Example: add to settings.php (or settings.local.php) in the development enviroment: $config['system.logging']['error_level'] = 'verbose'; This enables verbose error logging on that instance.
  • 21.  Chapter 3: Can I override local configuration? 📝 $config and editing Even after the override admin/config/development/logging shows the original (non-overridden) settings. This is wanted: Drupal prevents you from submitting overridden configuration.
  • 22.  Chapter 3: Can I override local configuration? 📝 $config and exporting Even after the override, $ drush cex exports the original settings. This is wanted too: Drupal will not let the override slip into the export.
  • 23.  Chapter 3: Can I override local configuration? ⚙ Mutable and immutable con guration Drupal can retrieve configuration as mutable or immutable. Immutable Retrieved in read-only mode (to apply/display; overrides are considered) Drupal::config('system.site'); Mutable Retrieved in read-write mode (to set/export values; overrides are ignored) Drupal::configFactory() ->getEditable('system.site');
  • 24.  Chapter 3: Can I override local configuration? 🔍 Finding keys and values: mapping Keys/values for $config are mapped from the YAML files. --- a/sync/system.logging.yml +++ b/sync/system.logging.yml @@ -1,3 +1,3 @@ -error_level: hide +error_level: verbose _core: default_config_hash: u3-njszl92FaxjrCMiq0yDcjAfcdx72 becomes: $config['system.logging']['error_level'] = 'verbose';
  • 25.  Chapter 3: Can I override local configuration? 📝 A satisfactory solution? $config covers our need for differentiating configuration between environments but... You can only alter existing configuration. You can't add new configuration using $config You can't completely "unset" existing configuration using $config You can't override which modules are installed. You can't override the color of Bartik and other details. The contrib module has the same limitations. But it is great for run-time overriding configuration from modules. Config overrride
  • 26. Chapter 4 🚫 Can I exclude modules from getting deployed? Can I have development modules enabled on a development environment but not deploy them to the production site?
  • 27. 🚫 Chapter 4: Can I exclude modules from getting deployed? ✂ Con guration split Configuration override not at runtime but at import/export time. Split off some configuration to dedicated folder. Break up the monolithic configuration. Blacklist configuration. Specify set of configuration with wildcards. Configured by configuration entities. Works with drush >8.1.10 drush config-export drush config-import
  • 28. 🚫 Chapter 4: Can I exclude modules from getting deployed? ✂ Con guration split
  • 29.
  • 30. 🚫 Chapter 4: Can I exclude modules from getting deployed? ✂ Con guration split Split off only config which is different from the default and leave the original one in place. → Graylist. Import or export only the config which is split off. drush config-split-export dev drush config-split-import dev Decide which split configuration to use per environment. $config['config_split.config_split.dev']['status'] = TRUE;
  • 31. 🚫 Chapter 4: Can I exclude modules from getting deployed? ✂ Con g split et. al. Depends on which provides a ConfigFilter plugin. Swaps cores sync storage → Works with default drush commands. Wait to get mature in contrib (96 sites 0 bugs so far) ... and then move to core. Config Filter
  • 32. 🚫 Chapter 4: Can I exclude modules from getting deployed?  Other Methods drush: Drush used to have --skip-modules but it didn't work well. Basic concept is moved to and is removed from drush!Config Filter PR#2684 drush_cmi_tools: https://github.com/previousnext/drush_cmi_tools Operates with a list of configuration to ignore, own drush commands.
  • 33. Chapter 5  👽 👻 Can I work in parallel with a colleague? Can two or more developers work simultaneously on the same project? How do I ensure that my work is not lost? Can I assume that Git will always do the right thing when merging?
  • 34.  👽 👻 Chapter 5: Can I work in parallel with a colleague? Git to the rescue Configuration Management is designed to share configuration between different environments. Configuration is exported to text files. And for text files we have Git!
  • 35.  👽 👻 Chapter 5: Can I work in parallel with a colleague? Working as a  👽 👻 Team of developers Share a Git repository for both code and configuration. Install site starting from initial configuration. Adopt “A successful Git branching model” (cit.)
  • 36.  👽 👻 Chapter 5: Can I work in parallel with a colleague?  👽 👻 Project bootstrap  First developer: Initialise repository. Installs site locally. Exports configuration to sync. Commits and pushes to shared Git repository. 👽 👻 Other developers (and prod): Clone code. Have config_installer profile available. Install site starting from exported configuration.
  • 37.  👽 👻 Chapter 5: Can I work in parallel with a colleague?  👽 👻 Parallel development  First developer: Own branch: checkout -b feature-a (code, code, code...) Commits and pushes to shared Git repository. 👽 👻 Other developer(s): Own branch: checkout -b feature-b (code, code, code...) Commit and push to shared Git repository. ...but careless merge is dangerous and problematic.
  • 38.  👽 👻 Chapter 5: Can I work in parallel with a colleague? Collaboration issues A careless workflow may result in: Losing all uncommitted work. Accidentally overwrite work by others. A configuration that looks OK at first sight but that is actually invalid for Drupal.
  • 39.  👽 👻 Chapter 5: Can I work in parallel with a colleague? 📦 The safe sequence for sharing 1. Export configuration: drush cex 2. Commit 3. Merge: git pull 4. Update dependencies: composer install 5. Run updates: drush updb 6. Import configuration: drush cim 7. Push: git push
  • 40.  👽 👻 Chapter 5: Can I work in parallel with a colleague? 📦 If you do it wrong... Import before Export: Deletes your work, no backup. Merge before Export: Export deletes previous work, solved by git. No updb or after cim, will be disallowed, database might be broken. No composer install, may not have all the updated code. Merge before Commit: Manual labour on conflicts. Forgotten Import: Next export will not contain merged config, more difficult to solve in git.
  • 41.  👽 👻 Chapter 5: Can I work in parallel with a colleague? 📦 The safe sequence for updating 1. Update code: composer update 2. Run updates: drush updb 3. Export updated config: drush cex 4. Commit 5. Push: git push
  • 42.  👽 👻 Chapter 5: Can I work in parallel with a colleague? Breaking con guration with Git Setup: Installed standard profile Developer A on branch feature-a deletes Tags from 'Article'. Resulting configuration change: 2 files are removed (field instance and field storage) Developer B on branch feature-b adds Tags to 'Basic page'. Resulting configuration change: 1 file is added (field instance) Git will happily merge feature-a and feature-b into develop The resulting configuration is invalid: Tags has a field instance but no storage. Takeaway: when merging check that the configuration is still valid by importing it.
  • 43. Chapter 6 ☢ Can I handle a client messing with production con guration?
  • 44. ☢ Chapter 6: Can I handle a client messing with production configuration? 💀 Changes on production Imagine the ideal situation: Configuration is correctly exported, versioned and deployed Development team adopts a solid GIT branching model BUT... Configuration on production is changed by your Geeky Client™ overnight, without notice.
  • 45. ☢ Chapter 6: Can I handle a client messing with production configuration? 🔒 Option 1 Lock con guration on production Don’t allow config changes on the production site if ever possible by installing the config_readonly module. Note: add this to settings.php in production: $settings['config_readonly'] = TRUE;
  • 46. ☢ Chapter 6: Can I handle a client messing with production configuration? ☢ Option 2 Export to a dedicated branch Have a person responsible for merging prod and dev configuration.
  • 47. ☢ Chapter 6: Can I handle a client messing with production configuration? ✂ Option 3 Con guration split Review changes done by the client on production and choose what to keep → graylist. Export production changes via drush config-split-export to ../config/client Pull new configuration: business as usual Deploy configuration changes via drush cim: business as usual Configuration is imported from both ../config/sync and ../config/client
  • 48. Chapter 7  Can I package con guration and re-use it?
  • 49.  Chapter 7: Can I package configuration and re-use it? 📦   Features for Drupal 8 The Features module: a configuration packager. Entirely new for Drupal 8, to take advantage of Configuration Management. Offers automatic packaging: Features analyzes your site and automatically packages up site configuration into a set of features.
  • 50.  Chapter 7: Can I package configuration and re-use it? 📦   Features for Drupal 8 Focuses on packaging configuration for reuse purpose only. Is meant to be a development module: generated features do not depend on the Features module. The resulting features are modules: just enable to activate their configuration.
  • 51.  Chapter 7: Can I package configuration and re-use it? 📦   Using Features Enable the Features module - only in development, not needed in production. Enable the dedicated Features UI module too. Generate the Features at admin/config/development/features Enable the Features modules you generated; these are portable between sites.
  • 52.  Chapter 7: Can I package configuration and re-use it? 📦   Features work ow If you use Features 8.x for deployment: You are doing it wrong.™ Re-use partial configuration between different sites. Use Features in development environments only. Use for distributions rather than individual projects.
  • 53. Chapter 8  Can I deploy the content my con guration depends upon? What about a view that depends on a taxonomy term? Can I have default content on my site? Can I change content with my deployment?
  • 54.  Chapter 8: Can I deploy the content my configuration depends upon?  Deploying content Scenario: Deploying configuration that depends on content such as nodes, blocks, taxonomy terms, etc. Problem: Content is not exported along with configuration.
  • 55.  Chapter 8: Can I deploy the content my configuration depends upon?  Option 1 Handle missing content event When content required by configuration is missing Drupal fires a ConfigEvents::IMPORT_MISSING_CONTENT event. You could subscribe to that event via an event subscriber and, for example, perform a run-time migration using Migrate (now in core). If nothing happens Drupal will handle it for you on DrupalCoreConfigImporterFinalMissingContentSubscriber which will just remove content dependencies, run-time.
  • 56.  Chapter 8: Can I deploy the content my configuration depends upon?  Option 2 Use default_content module Any module that requires default content can provide hal+json versions of the entities inside {module_name}/content/{entity_type} folders. Entity references are respected by Drupal 8 core thanks to the HAL core module and content entities having UUID by default. Content is imported when the module is installed.
  • 57.  Chapter 8: Can I deploy the content my configuration depends upon?  Option 3 Use deploy From the module's page at https://www.drupal.org/project/deploy The Deploy module is designed to allow users to easily stage and preview content for a Drupal site.
  • 58.  Chapter 8: Can I deploy the content my configuration depends upon?  Working with content updates In Drupal 8 there is a post update hook specifically designed to work with content. function hook_post_update_NAME(&$sandbox) { } New with proof of concept module :Config Import N function hook_pre_config_import_NAME(&$sandbox) { } function hook_post_config_import_NAME(&$sandbox) { }
  • 59.  Related contrib projects config_installer install site from existing config. config_filter filter config at import/export time. config_split import time config override. config_readonly locks any configuration changes via UI. config_override help with run-time config override. config_tools automatically commit config changes to git.
  • 60.  Related contrib projects config_devel module helps with developing configuration. config_update report changes between original and active config of a module. features bundle config for re-use on different site, ideal for distributions. config_sync provides methods for safely importing site configuration from updated modules and themes. config_ignore remove config from config management.