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

What's hot (20)

PDF
Using Composer with Drupal and Drush
Pantheon
 
PDF
Lean Drupal Repositories with Composer and Drush
Pantheon
 
PDF
Docman - The swiss army knife for Drupal multisite docroot management and dep...
Aleksey Tkachenko
 
PPTX
Drupal 8 deploying
Andrew Siz
 
PDF
Drupal 8 CMI on a Managed Workflow
Pantheon
 
PDF
The OpenEuropa Initiative
Nuvole
 
PDF
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
Phase2
 
PDF
Development Workflow Tools for Open-Source PHP Libraries
Pantheon
 
PDF
Drupal 8 Configuration Management with Features
Nuvole
 
PDF
Drupal Best Practices
Mukesh Agarwal
 
PDF
Yet Another Drupal Development/Deployment Presentation
digital006
 
PDF
Building and Maintaining a Distribution in Drupal 7 with Features
Nuvole
 
PDF
Composer & Drupal
drubb
 
PDF
11 tools for your PHP devops stack
Kris Buytaert
 
PDF
Java User Group Cologne
Software Entwicklung Beratung Schulung
 
PDF
Drupal 8 improvements for developer productivity php symfony and more
Acquia
 
PDF
Headless Drupal
drubb
 
PDF
Speedrun: Build a Website with Panels, Media, and More in 45 Minutes
Acquia
 
KEY
Automating Drupal Development: Makefiles, features and beyond
Nuvole
 
PDF
Webkit/chromium contribution process
NAVER LABS
 
Using Composer with Drupal and Drush
Pantheon
 
Lean Drupal Repositories with Composer and Drush
Pantheon
 
Docman - The swiss army knife for Drupal multisite docroot management and dep...
Aleksey Tkachenko
 
Drupal 8 deploying
Andrew Siz
 
Drupal 8 CMI on a Managed Workflow
Pantheon
 
The OpenEuropa Initiative
Nuvole
 
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
Phase2
 
Development Workflow Tools for Open-Source PHP Libraries
Pantheon
 
Drupal 8 Configuration Management with Features
Nuvole
 
Drupal Best Practices
Mukesh Agarwal
 
Yet Another Drupal Development/Deployment Presentation
digital006
 
Building and Maintaining a Distribution in Drupal 7 with Features
Nuvole
 
Composer & Drupal
drubb
 
11 tools for your PHP devops stack
Kris Buytaert
 
Drupal 8 improvements for developer productivity php symfony and more
Acquia
 
Headless Drupal
drubb
 
Speedrun: Build a Website with Panels, Media, and More in 45 Minutes
Acquia
 
Automating Drupal Development: Makefiles, features and beyond
Nuvole
 
Webkit/chromium contribution process
NAVER LABS
 

Viewers also liked (14)

PPTX
Tips and tricks for building Large web applications with Drupal
MitzaCeusan
 
PPT
Local Drupal MultiSite Set-up
Manuel Felix G. Abejo Jr.
 
PPTX
Ag Comm Drupal 7 Platform Initiative Intro
ashooner
 
PDF
Drupal multisite
Ly Phuong
 
PPTX
Skillsume brochure
Sunil Javaji
 
ODP
Domain Access Module
Ryan Cross
 
PDF
August 2015 - Web Governance - PWP Introduction
Eric Sembrat
 
PDF
drush_multi @ DrupalDevDays 2010
Florian Latzel
 
PDF
Drush und Multisite: drush_multi
Florian Latzel
 
PDF
Inside OpenChange scalable architecture
Julien Kerihuel
 
PDF
Drupal Multisite Setup
ipsitamishra
 
KEY
Drupal Multisite
Peter Arato
 
PDF
Créez votre site web vous-même 2/2
pro-info.be
 
PPTX
Олександр Лінивий — Multisite platform with continuous delivery process for m...
LEDC 2016
 
Tips and tricks for building Large web applications with Drupal
MitzaCeusan
 
Local Drupal MultiSite Set-up
Manuel Felix G. Abejo Jr.
 
Ag Comm Drupal 7 Platform Initiative Intro
ashooner
 
Drupal multisite
Ly Phuong
 
Skillsume brochure
Sunil Javaji
 
Domain Access Module
Ryan Cross
 
August 2015 - Web Governance - PWP Introduction
Eric Sembrat
 
drush_multi @ DrupalDevDays 2010
Florian Latzel
 
Drush und Multisite: drush_multi
Florian Latzel
 
Inside OpenChange scalable architecture
Julien Kerihuel
 
Drupal Multisite Setup
ipsitamishra
 
Drupal Multisite
Peter Arato
 
Créez votre site web vous-même 2/2
pro-info.be
 
Олександр Лінивий — Multisite platform with continuous delivery process for m...
LEDC 2016
 
Ad

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

PDF
Getting Into Drupal 8 Configuration
Philip Norton
 
PDF
Creating a Reusable Drupal Website for Higher Education - Webinar
Suzanne Dergacheva
 
PDF
DDAY2014 - Features per Drupal 8
DrupalDay
 
PDF
CMI feedback.dnd
Alexandre Todorov
 
PDF
Drupal & Drink Montpellier "CMI feedback"
Alexandre Todorov
 
PDF
Drupal 8 Configuration Management
Philip Norton
 
PDF
Config management
Alexei Goja
 
PDF
Drupal 8 configuration management
Alexander Tkachev
 
PDF
Drupal 8 Configuration Management for you and your team
Luc Bézier
 
PPTX
Drupal 8 Configuration Management
Sathya Sheela Sankaralingam
 
PDF
Developing with Configuration Management on Drupal 7
Ryan Szrama
 
PDF
CMI 2.0 session at Drupal DevDays in Cluj-Napoca
Nuvole
 
PDF
Gestione della configurazione in Drupal 8
Eugenio Minardi
 
PPT
Drupal con Sydney configuration management in drupal 7
Arradi Nur Rizal
 
PDF
Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)
Nuvole
 
PPTX
Exploring composer in drupal 8 with drupal project - salva molina
Salvador Molina (Slv_)
 
PDF
Improving your Drupal 8 development workflow DrupalCampLA
Jesus Manuel Olivas
 
PDF
Configuration Management in Drupal 8: A preview (DrupalCamp Alpe Adria 2014)
Nuvole
 
PDF
Олексій Калініченко — Configuration Management in Drupal8
LEDC 2016
 
PPTX
Getting started with drupal 8 code
Forum One
 
Getting Into Drupal 8 Configuration
Philip Norton
 
Creating a Reusable Drupal Website for Higher Education - Webinar
Suzanne Dergacheva
 
DDAY2014 - Features per Drupal 8
DrupalDay
 
CMI feedback.dnd
Alexandre Todorov
 
Drupal & Drink Montpellier "CMI feedback"
Alexandre Todorov
 
Drupal 8 Configuration Management
Philip Norton
 
Config management
Alexei Goja
 
Drupal 8 configuration management
Alexander Tkachev
 
Drupal 8 Configuration Management for you and your team
Luc Bézier
 
Drupal 8 Configuration Management
Sathya Sheela Sankaralingam
 
Developing with Configuration Management on Drupal 7
Ryan Szrama
 
CMI 2.0 session at Drupal DevDays in Cluj-Napoca
Nuvole
 
Gestione della configurazione in Drupal 8
Eugenio Minardi
 
Drupal con Sydney configuration management in drupal 7
Arradi Nur Rizal
 
Configuration Management in Drupal 8: A preview (DrupalDays Milano 2014)
Nuvole
 
Exploring composer in drupal 8 with drupal project - salva molina
Salvador Molina (Slv_)
 
Improving your Drupal 8 development workflow DrupalCampLA
Jesus Manuel Olivas
 
Configuration Management in Drupal 8: A preview (DrupalCamp Alpe Adria 2014)
Nuvole
 
Олексій Калініченко — Configuration Management in Drupal8
LEDC 2016
 
Getting started with drupal 8 code
Forum One
 
Ad

More from Erich Beyrent (6)

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

Recently uploaded (20)

PDF
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
PPTX
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
PDF
Letasoft Sound Booster 1.12.0.538 Crack Download+ Product Key [Latest]
HyperPc soft
 
PPTX
How Odoo Became a Game-Changer for an IT Company in Manufacturing ERP
SatishKumar2651
 
PDF
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PPTX
Engineering the Java Web Application (MVC)
abhishekoza1981
 
PDF
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
PPTX
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PPTX
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PDF
Executive Business Intelligence Dashboards
vandeslie24
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PPTX
Java Native Memory Leaks: The Hidden Villain Behind JVM Performance Issues
Tier1 app
 
PDF
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
PDF
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
PPTX
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
PDF
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
Letasoft Sound Booster 1.12.0.538 Crack Download+ Product Key [Latest]
HyperPc soft
 
How Odoo Became a Game-Changer for an IT Company in Manufacturing ERP
SatishKumar2651
 
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
Engineering the Java Web Application (MVC)
abhishekoza1981
 
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
Human Resources Information System (HRIS)
Amity University, Patna
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Executive Business Intelligence Dashboards
vandeslie24
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
Java Native Memory Leaks: The Hidden Villain Behind JVM Performance Issues
Tier1 app
 
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 

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