SlideShare a Scribd company logo
CONFIGURATION AS
DEPENDENCY
Managing Drupal 8 Configuration
with Git and Composer
ERICH BEYRENT
➤ Senior Drupal Developer at
BioRAFT
➤ Working with Drupal since
2004
➤ Drupal: https://drupal.org/u/ebeyrent
➤ Twitter: https:/twitter.com/ebeyrent
➤ Github: https://github.com/ebeyrent
Moshe Weitzman
Justin Ludwig
Justin works for BioRAFT as a Development
Engineer and am responsible for anything that
gets thrown my way. He thrives in areas related
to user management including SSO & permissions
templates as well as adding some whizz-bang to
sites with jQuery. Drupal has been his tool of
choice since 2007.
Moshe has been a consistent contributor to Drupal
core and Contrib since November 2001. As such, he
has pretty much touched the whole core code. He
maintains the user.module, the bootstrap code, and
the groups.drupal.org web site.
AGENDA
➤ Overview of Drupal 8 configuration management
AGENDA
➤ Overview of Drupal 8 configuration management
➤ Managing your Git repository
AGENDA
➤ Overview of Drupal 8 configuration management
➤ Managing your Git repository
➤ Using Composer and Drupal Console
AGENDA
➤ Overview of Drupal 8 configuration management
➤ Managing your Git repository
➤ Using Composer and Drupal Console
➤ Multisite considerations
https://www.flickr.com/photos/majathurup/2305054569/
BACKGROUND
➤ Pre-Drupal 8 Challenges
➤ Configuration cannot easily be represented in code
➤ Configuration changes performed by clients and/or client
services cannot be represented in code without going
through patch/release with developers
BACKGROUND
➤ Drupal 8 Goals
➤ Allow non-developers to change configuration safely
➤ Clients can safely change configurations to the extent that
they are allowed
➤ Provide an audit trail of all configuration changes made
➤ Easily and automatically create new instances of sites with
default configurations
Two Types of Configuration in Drupal 8
http://www.moviepulp.be/wp-content/uploads/2007/04/alienvspredator.jpg
DRUPAL 8 CONFIGURATION SYSTEM
➤ Standardizes configuration export into YAML files
➤ Used for both simple config and config entities (fields, views,
workflows, roles, etc)
“Sites own their configuration, not
modules.
- Alex Pott
https://www.chapterthree.com/blog/principles-of-configuration-management-part-two
https://dev.acquia.com/blog/ultimate-guide-drupal-8-episode-6-new-back-end-features-drupal-8
DRUPAL 8 CONFIGURATION SYSTEM
➤ Contrib/custom modules have the same tools for enabling
default configurations
➤ Default YAML files are stored with the module
➤ Once a module is installed, the site now owns the config and
those YAML files are copied to the site-wide config directory
DRUPAL 8 CONFIGURATION SYSTEM
➤ Robust system for managing hard and soft/optional
dependencies
➤ Nested module dependencies are automatically added to the
configuration (when exported)
USEFUL CONFIGURATION MODULES
➤ Configuration Update
https://www.drupal.org/project/config_update
➤ Configuration Tools
https://www.drupal.org/project/config_tools
➤ Configuration Synchronizer
https://www.drupal.org/project/config_sync
➤ Configuration Development
https://www.drupal.org/project/config_devel
➤ Configuration Log
https://www.drupal.org/project/config_log
WANT MORE INFORMATION?
http://drupalnights.org/events/2015/moshe-weitzman-d8-configuration-management
Watch Moshe Weitzman’s DrupalNights presentation about
Drupal 8’s configuration management system!
“There is no “recommended”
workflow.
-Matthew Tift
https://www.lullabot.com/articles/configuration-management-in-drupal-8-the-key-concepts
Configuration as Dependency: Managing Drupal 8 Configuration with git and Composer
GIT REPO STRATEGY
➤ Create two repositories:



Code Configuration
https://cdn.meme.am/instances/59742810.jpg
YES, THERE’S TWO OF THEM
➤ Use git to manage individual site differences and conflict
resolution
➤ Default configurations for all sites can be managed on the
master branch of the configuration repository
➤ Each client site has its own branch of the Config Repo
➤ Code repository contains only custom modules/themes/
libraries, “sites” directory and build scripts
GIT REPO STRATEGY: CODE REPO
➤ All dependencies are managed by Composer
➤ Package and version added to composer.json and it is built
with all dependency dependencies resolved automatically
“Configuration is just another
dependency.
-Erich Beyrent
CONFIGURATION AS DEPENDENCY
➤ Manage configuration as a dependency in composer.json
➤ Use tags to identify configuration versions
"repositories": [
{
"type": "composer",
"url": "https://packagist.drupal-composer.org"
},
{
"type": "vcs",
"url": "https://github.com/weitzman/multiplesite-config.git"
}
],
"require": {
"composer/installers": "^1.0.20",
"drupal-composer/drupal-scaffold": "^2.0.1",
"cweagans/composer-patches": "~1.0",
"drupal/core": "~8.0",
"drush/drush": "8.x-dev",
"drupal/console": "~1.0",
"multiplesite-config/alpha": "dev-alpha",
"multiplesite-config/bravo": "dev-bravo"
},
"config": {
"preferred-install": {
"multiplesite-config/*": "source"
}
}
Configuration as Dependency: Managing Drupal 8 Configuration with git and Composer
Configuration as Dependency: Managing Drupal 8 Configuration with git and Composer
Configuration as Dependency: Managing Drupal 8 Configuration with git and Composer
"extra": {
"installer-paths": {
"config/{$name}": ["type:bonefish-package"],
"web/core": ["type:drupal-core"],
"web/modules/contrib/{$name}": ["type:drupal-module"],
"web/profiles/contrib/{$name}": ["type:drupal-profile"],
"web/themes/contrib/{$name}": ["type:drupal-theme"],
"drush/contrib/{$name}": ["type:drupal-drush"]
}
},
"scripts": {
"drupal-scaffold": "DrupalComposerDrupalScaffoldPlugin::scaffold",
"pre-install-cmd": [
"DrupalProjectcomposerScriptHandler::checkComposerVersion"
],
"pre-update-cmd": [
"DrupalProjectcomposerScriptHandler::checkComposerVersion"
],
"post-install-cmd": [
"DrupalProjectcomposerScriptHandler::createRequiredFiles"
],
"post-update-cmd": [
"DrupalProjectcomposerScriptHandler::createRequiredFiles"
]
},
GIT REPO STRATEGY: CONFIG REPO
➤ Master branch contains the default configurations for any/all
modules
➤ Each client site gets its own branch in the config repository
➤ For a site to work, we need both repos
➤ Master branch containing site defaults is mirrored from the
Config Repo into the Drupal Repo (read-only) using git
subtree split
DEVELOPER WORKFLOW
➤ Create a branch of Code Repo for a new ticket/card/bug/
feature and do some work
➤ The Config Repo will be available to edit configs for sites
where module is already enabled
➤ The same YAML will also have to be added to the module for
sites where it was never enabled
CONFIG REPO BENEFITS
➤ While a feature is being worked on, a specific version of config
can be used that won’t conflict with other features being
developed
➤ If a problem arises with configuration, it can easily be “rolled
back” by specifying the working version
➤ Exact replica of an entire site’s configuration can be built from
scratch during development or debugging without any client
data being used
MORE CONFIG REPO BENEFITS
➤ Helps determine if a bug involving config is actually solved
rather than just solved for a particular piece of data
➤ Helps with testing unique configuration considerations
➤ Potential to assist with new site rollouts
WHAT ELSE?
➤ Theme repositories?
MULTISITE CONFIGURATION REQUIREMENTS
➤ <?php return count($sites) >= 2; ?>
➤ Configuration defaults exist and may need to be updated
➤ Each site is configured uniquely and may override defaults as
required
➤ Both simple config (e.g. site name) and complex config
(“config entities”) may need to be overridden
➤ A config may need to be to be changed for a single site or a
group of sites
➤ Conflict management varies from case to case
THE EXPERIMENT
➤ https://github.com/weitzman/multiplesite
An experiment in how to to handle the "multisite" pattern in Drupal 8. This is
when you run dozens or hundreds of very similar sites. You want these sites to
vary configuration in slight ways, but still easily push out config changes to
all. Examples include one site for each member of Congress, or one site for
each musician in our portfolio.
IMPLEMENTATION
multisite multisite-config
master 

config
master 

config
client a 

branch
client b

branch
client c

branch
git subtree-split
IMPLEMENTATION ALTERNATIVE
multisite multisite-config
master 

config
master 

config
client a 

branch
client b

branch
client c

branch
x
IMPLEMENTATION
master 

config
client a 

branch
client b

branch
client c

branch
master
config
changes
git merge
client c
config
changes
PUSHING COMMITS
➤ When fixing bugs while using a client site, a developer can
choose to push commits to master config or to client config as
needed. Pushing to client config happens automatically since
that’s “origin”. If dev wants to integrate changes into
multiplesite, add a remote pointing to multiplesite and then
push commits there.


git remote add multiplesite https://github.com/weitzman/multiplesite.git

git checkout -b multiplesite-master multiplesite/master

git cherry-pick <COMMITS>

git push
IMPLEMENTATION
master 

config
client c

branch client c
configuration
config
changes
client c
production
database
SUMMARY
➤ Multisite projects have unique config requirements
➤ The proposed workflow should be able to handle all of those
requirements elegantly
➤ The process can be automated enough to reduce cognitive
strain and allow everyone to focus their energy on what
matters: the product!
RESOURCES
➤ https://www.drupal.org/developing/api/8/configuration
➤ https://dev.acquia.com/blog/ultimate-guide-drupal-8-
episode-6-new-back-end-features-drupal-8
➤ https://github.com/weitzman/multiplesite
➤ https://www.lullabot.com/articles/configuration-
management-in-drupal-8-the-key-concepts
➤ http://drupalnights.org/events/2015/moshe-weitzman-d8-
configuration-management
https://wordhavering.files.wordpress.com/2013/01/questions-and-answers1.jpg
BIORAFT
IS HIRING!
http://bioraft.com/company/careers

More Related Content

PDF
Configuration Deployment in Drupal 8
PDF
Advanced Configuration Management with Config Split et al.
PDF
Best Practice Site Architecture in Drupal 8
PDF
Composer tools and frameworks for drupal.ppt
PDF
Drupal 8: frontend development
PDF
Efficient development workflows with composer
PDF
Drupal + composer = new love !?
PDF
Efficient development workflows with composer
Configuration Deployment in Drupal 8
Advanced Configuration Management with Config Split et al.
Best Practice Site Architecture in Drupal 8
Composer tools and frameworks for drupal.ppt
Drupal 8: frontend development
Efficient development workflows with composer
Drupal + composer = new love !?
Efficient development workflows with composer

What's hot (20)

PDF
Using Composer with Drupal and Drush
PDF
Lean Drupal Repositories with Composer and Drush
PDF
Docman - The swiss army knife for Drupal multisite docroot management and dep...
PPTX
Drupal 8 deploying
PDF
Drupal 8 CMI on a Managed Workflow
PDF
The OpenEuropa Initiative
PDF
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
PDF
Development Workflow Tools for Open-Source PHP Libraries
PDF
Drupal 8 Configuration Management with Features
PDF
Drupal Best Practices
PDF
Yet Another Drupal Development/Deployment Presentation
PDF
Building and Maintaining a Distribution in Drupal 7 with Features
PDF
Composer & Drupal
PDF
11 tools for your PHP devops stack
PDF
PDF
Drupal 8 improvements for developer productivity php symfony and more
PDF
Headless Drupal
PDF
Speedrun: Build a Website with Panels, Media, and More in 45 Minutes
KEY
Automating Drupal Development: Makefiles, features and beyond
PDF
Webkit/chromium contribution process
Using Composer with Drupal and Drush
Lean Drupal Repositories with Composer and Drush
Docman - The swiss army knife for Drupal multisite docroot management and dep...
Drupal 8 deploying
Drupal 8 CMI on a Managed Workflow
The OpenEuropa Initiative
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
Development Workflow Tools for Open-Source PHP Libraries
Drupal 8 Configuration Management with Features
Drupal Best Practices
Yet Another Drupal Development/Deployment Presentation
Building and Maintaining a Distribution in Drupal 7 with Features
Composer & Drupal
11 tools for your PHP devops stack
Drupal 8 improvements for developer productivity php symfony and more
Headless Drupal
Speedrun: Build a Website with Panels, Media, and More in 45 Minutes
Automating Drupal Development: Makefiles, features and beyond
Webkit/chromium contribution process
Ad

Viewers also liked (14)

PPTX
Tips and tricks for building Large web applications with Drupal
PPT
Local Drupal MultiSite Set-up
PPTX
Ag Comm Drupal 7 Platform Initiative Intro
PDF
Drupal multisite
PPTX
Skillsume brochure
ODP
Domain Access Module
PDF
August 2015 - Web Governance - PWP Introduction
PDF
drush_multi @ DrupalDevDays 2010
PDF
Drush und Multisite: drush_multi
PDF
Inside OpenChange scalable architecture
PDF
Drupal Multisite Setup
KEY
Drupal Multisite
PDF
Créez votre site web vous-même 2/2
PPTX
Олександр Лінивий — Multisite platform with continuous delivery process for m...
Tips and tricks for building Large web applications with Drupal
Local Drupal MultiSite Set-up
Ag Comm Drupal 7 Platform Initiative Intro
Drupal multisite
Skillsume brochure
Domain Access Module
August 2015 - Web Governance - PWP Introduction
drush_multi @ DrupalDevDays 2010
Drush und Multisite: drush_multi
Inside OpenChange scalable architecture
Drupal Multisite Setup
Drupal Multisite
Créez votre site web vous-même 2/2
Олександр Лінивий — Multisite platform with continuous delivery process for m...
Ad

Similar to Configuration as Dependency: Managing Drupal 8 Configuration with git and Composer (20)

PDF
Getting Into Drupal 8 Configuration
PDF
Creating a Reusable Drupal Website for Higher Education - Webinar
PDF
DDAY2014 - Features per Drupal 8
PDF
CMI feedback.dnd
PDF
Drupal & Drink Montpellier "CMI feedback"
PDF
Drupal 8 Configuration Management
PDF
Config management
PDF
Drupal 8 configuration management
PDF
Drupal 8 Configuration Management for you and your team
PPTX
Drupal 8 Configuration Management
PDF
Developing with Configuration Management on Drupal 7
PDF
CMI 2.0 session at Drupal DevDays in Cluj-Napoca
PDF
Gestione della configurazione in Drupal 8
PPT
Drupal con Sydney configuration management in drupal 7
PDF
Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)
PPTX
Exploring composer in drupal 8 with drupal project - salva molina
PDF
Improving your Drupal 8 development workflow DrupalCampLA
PDF
Configuration Management in Drupal 8: A preview (DrupalCamp Alpe Adria 2014)
PDF
Олексій Калініченко — Configuration Management in Drupal8
PPTX
Getting started with drupal 8 code
Getting Into Drupal 8 Configuration
Creating a Reusable Drupal Website for Higher Education - Webinar
DDAY2014 - Features per Drupal 8
CMI feedback.dnd
Drupal & Drink Montpellier "CMI feedback"
Drupal 8 Configuration Management
Config management
Drupal 8 configuration management
Drupal 8 Configuration Management for you and your team
Drupal 8 Configuration Management
Developing with Configuration Management on Drupal 7
CMI 2.0 session at Drupal DevDays in Cluj-Napoca
Gestione della configurazione in Drupal 8
Drupal con Sydney configuration management in drupal 7
Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)
Exploring composer in drupal 8 with drupal project - salva molina
Improving your Drupal 8 development workflow DrupalCampLA
Configuration Management in Drupal 8: A preview (DrupalCamp Alpe Adria 2014)
Олексій Калініченко — Configuration Management in Drupal8
Getting started with drupal 8 code

More from Erich Beyrent (6)

PDF
{ JSON:API} 2 - A Path to Decoupled Drupal
PDF
Test your modules
PDF
Digital Mayflower - Data Pilgrimage with the Drupal Migrate Module
PPT
Hack-Proof Your Drupal App
PPT
Staging Drupal: Change Management Strategies for Drupal
PPT
Staging Drupal: Change Management Strategies for Drupal
{ JSON:API} 2 - A Path to Decoupled Drupal
Test your modules
Digital Mayflower - Data Pilgrimage with the Drupal Migrate Module
Hack-Proof Your Drupal App
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal

Recently uploaded (20)

PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPT
Introduction Database Management System for Course Database
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PPTX
L1 - Introduction to python Backend.pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
history of c programming in notes for students .pptx
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
System and Network Administration Chapter 2
PDF
Understanding Forklifts - TECH EHS Solution
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Nekopoi APK 2025 free lastest update
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
top salesforce developer skills in 2025.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Navsoft: AI-Powered Business Solutions & Custom Software Development
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Introduction Database Management System for Course Database
ManageIQ - Sprint 268 Review - Slide Deck
L1 - Introduction to python Backend.pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
How to Choose the Right IT Partner for Your Business in Malaysia
history of c programming in notes for students .pptx
Upgrade and Innovation Strategies for SAP ERP Customers
System and Network Administration Chapter 2
Understanding Forklifts - TECH EHS Solution
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Nekopoi APK 2025 free lastest update
CHAPTER 2 - PM Management and IT Context
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
top salesforce developer skills in 2025.pdf

Configuration as Dependency: Managing Drupal 8 Configuration with git and Composer

  • 1. CONFIGURATION AS DEPENDENCY Managing Drupal 8 Configuration with Git and Composer
  • 2. ERICH BEYRENT ➤ Senior Drupal Developer at BioRAFT ➤ Working with Drupal since 2004 ➤ Drupal: https://drupal.org/u/ebeyrent ➤ Twitter: https:/twitter.com/ebeyrent ➤ Github: https://github.com/ebeyrent
  • 3. Moshe Weitzman Justin Ludwig Justin works for BioRAFT as a Development Engineer and am responsible for anything that gets thrown my way. He thrives in areas related to user management including SSO & permissions templates as well as adding some whizz-bang to sites with jQuery. Drupal has been his tool of choice since 2007. Moshe has been a consistent contributor to Drupal core and Contrib since November 2001. As such, he has pretty much touched the whole core code. He maintains the user.module, the bootstrap code, and the groups.drupal.org web site.
  • 4. AGENDA ➤ Overview of Drupal 8 configuration management
  • 5. AGENDA ➤ Overview of Drupal 8 configuration management ➤ Managing your Git repository
  • 6. AGENDA ➤ Overview of Drupal 8 configuration management ➤ Managing your Git repository ➤ Using Composer and Drupal Console
  • 7. AGENDA ➤ Overview of Drupal 8 configuration management ➤ Managing your Git repository ➤ Using Composer and Drupal Console ➤ Multisite considerations
  • 9. BACKGROUND ➤ Pre-Drupal 8 Challenges ➤ Configuration cannot easily be represented in code ➤ Configuration changes performed by clients and/or client services cannot be represented in code without going through patch/release with developers
  • 10. BACKGROUND ➤ Drupal 8 Goals ➤ Allow non-developers to change configuration safely ➤ Clients can safely change configurations to the extent that they are allowed ➤ Provide an audit trail of all configuration changes made ➤ Easily and automatically create new instances of sites with default configurations
  • 11. Two Types of Configuration in Drupal 8 http://www.moviepulp.be/wp-content/uploads/2007/04/alienvspredator.jpg
  • 12. DRUPAL 8 CONFIGURATION SYSTEM ➤ Standardizes configuration export into YAML files ➤ Used for both simple config and config entities (fields, views, workflows, roles, etc)
  • 13. “Sites own their configuration, not modules. - Alex Pott https://www.chapterthree.com/blog/principles-of-configuration-management-part-two
  • 15. DRUPAL 8 CONFIGURATION SYSTEM ➤ Contrib/custom modules have the same tools for enabling default configurations ➤ Default YAML files are stored with the module ➤ Once a module is installed, the site now owns the config and those YAML files are copied to the site-wide config directory
  • 16. DRUPAL 8 CONFIGURATION SYSTEM ➤ Robust system for managing hard and soft/optional dependencies ➤ Nested module dependencies are automatically added to the configuration (when exported)
  • 17. USEFUL CONFIGURATION MODULES ➤ Configuration Update https://www.drupal.org/project/config_update ➤ Configuration Tools https://www.drupal.org/project/config_tools ➤ Configuration Synchronizer https://www.drupal.org/project/config_sync ➤ Configuration Development https://www.drupal.org/project/config_devel ➤ Configuration Log https://www.drupal.org/project/config_log
  • 18. WANT MORE INFORMATION? http://drupalnights.org/events/2015/moshe-weitzman-d8-configuration-management Watch Moshe Weitzman’s DrupalNights presentation about Drupal 8’s configuration management system!
  • 19. “There is no “recommended” workflow. -Matthew Tift https://www.lullabot.com/articles/configuration-management-in-drupal-8-the-key-concepts
  • 21. GIT REPO STRATEGY ➤ Create two repositories:
 
 Code Configuration
  • 23. YES, THERE’S TWO OF THEM ➤ Use git to manage individual site differences and conflict resolution ➤ Default configurations for all sites can be managed on the master branch of the configuration repository ➤ Each client site has its own branch of the Config Repo ➤ Code repository contains only custom modules/themes/ libraries, “sites” directory and build scripts
  • 24. GIT REPO STRATEGY: CODE REPO ➤ All dependencies are managed by Composer ➤ Package and version added to composer.json and it is built with all dependency dependencies resolved automatically
  • 25. “Configuration is just another dependency. -Erich Beyrent
  • 26. CONFIGURATION AS DEPENDENCY ➤ Manage configuration as a dependency in composer.json ➤ Use tags to identify configuration versions
  • 27. "repositories": [ { "type": "composer", "url": "https://packagist.drupal-composer.org" }, { "type": "vcs", "url": "https://github.com/weitzman/multiplesite-config.git" } ],
  • 28. "require": { "composer/installers": "^1.0.20", "drupal-composer/drupal-scaffold": "^2.0.1", "cweagans/composer-patches": "~1.0", "drupal/core": "~8.0", "drush/drush": "8.x-dev", "drupal/console": "~1.0", "multiplesite-config/alpha": "dev-alpha", "multiplesite-config/bravo": "dev-bravo" },
  • 33. "extra": { "installer-paths": { "config/{$name}": ["type:bonefish-package"], "web/core": ["type:drupal-core"], "web/modules/contrib/{$name}": ["type:drupal-module"], "web/profiles/contrib/{$name}": ["type:drupal-profile"], "web/themes/contrib/{$name}": ["type:drupal-theme"], "drush/contrib/{$name}": ["type:drupal-drush"] } },
  • 34. "scripts": { "drupal-scaffold": "DrupalComposerDrupalScaffoldPlugin::scaffold", "pre-install-cmd": [ "DrupalProjectcomposerScriptHandler::checkComposerVersion" ], "pre-update-cmd": [ "DrupalProjectcomposerScriptHandler::checkComposerVersion" ], "post-install-cmd": [ "DrupalProjectcomposerScriptHandler::createRequiredFiles" ], "post-update-cmd": [ "DrupalProjectcomposerScriptHandler::createRequiredFiles" ] },
  • 35. GIT REPO STRATEGY: CONFIG REPO ➤ Master branch contains the default configurations for any/all modules ➤ Each client site gets its own branch in the config repository ➤ For a site to work, we need both repos ➤ Master branch containing site defaults is mirrored from the Config Repo into the Drupal Repo (read-only) using git subtree split
  • 36. DEVELOPER WORKFLOW ➤ Create a branch of Code Repo for a new ticket/card/bug/ feature and do some work ➤ The Config Repo will be available to edit configs for sites where module is already enabled ➤ The same YAML will also have to be added to the module for sites where it was never enabled
  • 37. CONFIG REPO BENEFITS ➤ While a feature is being worked on, a specific version of config can be used that won’t conflict with other features being developed ➤ If a problem arises with configuration, it can easily be “rolled back” by specifying the working version ➤ Exact replica of an entire site’s configuration can be built from scratch during development or debugging without any client data being used
  • 38. MORE CONFIG REPO BENEFITS ➤ Helps determine if a bug involving config is actually solved rather than just solved for a particular piece of data ➤ Helps with testing unique configuration considerations ➤ Potential to assist with new site rollouts
  • 39. WHAT ELSE? ➤ Theme repositories?
  • 40. MULTISITE CONFIGURATION REQUIREMENTS ➤ <?php return count($sites) >= 2; ?> ➤ Configuration defaults exist and may need to be updated ➤ Each site is configured uniquely and may override defaults as required ➤ Both simple config (e.g. site name) and complex config (“config entities”) may need to be overridden ➤ A config may need to be to be changed for a single site or a group of sites ➤ Conflict management varies from case to case
  • 41. THE EXPERIMENT ➤ https://github.com/weitzman/multiplesite An experiment in how to to handle the "multisite" pattern in Drupal 8. This is when you run dozens or hundreds of very similar sites. You want these sites to vary configuration in slight ways, but still easily push out config changes to all. Examples include one site for each member of Congress, or one site for each musician in our portfolio.
  • 42. IMPLEMENTATION multisite multisite-config master 
 config master 
 config client a 
 branch client b
 branch client c
 branch git subtree-split
  • 43. IMPLEMENTATION ALTERNATIVE multisite multisite-config master 
 config master 
 config client a 
 branch client b
 branch client c
 branch x
  • 44. IMPLEMENTATION master 
 config client a 
 branch client b
 branch client c
 branch master config changes git merge client c config changes
  • 45. PUSHING COMMITS ➤ When fixing bugs while using a client site, a developer can choose to push commits to master config or to client config as needed. Pushing to client config happens automatically since that’s “origin”. If dev wants to integrate changes into multiplesite, add a remote pointing to multiplesite and then push commits there. git remote add multiplesite https://github.com/weitzman/multiplesite.git git checkout -b multiplesite-master multiplesite/master git cherry-pick <COMMITS> git push
  • 46. IMPLEMENTATION master 
 config client c
 branch client c configuration config changes client c production database
  • 47. SUMMARY ➤ Multisite projects have unique config requirements ➤ The proposed workflow should be able to handle all of those requirements elegantly ➤ The process can be automated enough to reduce cognitive strain and allow everyone to focus their energy on what matters: the product!
  • 48. RESOURCES ➤ https://www.drupal.org/developing/api/8/configuration ➤ https://dev.acquia.com/blog/ultimate-guide-drupal-8- episode-6-new-back-end-features-drupal-8 ➤ https://github.com/weitzman/multiplesite ➤ https://www.lullabot.com/articles/configuration- management-in-drupal-8-the-key-concepts ➤ http://drupalnights.org/events/2015/moshe-weitzman-d8- configuration-management