multisite, multiple docroots & multiple agencies management for drupal
DESCRIPTION
Presentation done during Drupal Con Amsterdam in 2014. Introducing Docman (available on github, alpha state, but used already in production environment): the Swiss Army Knife for Drupal multisite docroot management and deployment. Docman acts as a layer between your docroot – usually a git repository somewhere, but not limited to it– and multiple vendors working on different websites using your standards and predefined sets of modules. Remember how hosting sales teams always tried to push you to buy more docroots "because otherwise it would be hard to manage websites in a Drupal multisite environment"? Docman can simplify your life so you will be able to stick to one docroot and multiple independent websites in it using the same Drupal core. Have you ever tried to oblige different vendors to work with one Drupal core for completely different websites, inside a multisite environment, without making them break everything and with clear deployment schema? Find out how docman can make the once daunting task of multisite deployment more efficient. Does the governance of multiple projects in one multisite environment scare you? Docman has hooks, like Drupal, to launch your tests whenever needed and for each website in multisite environment independently. During this presentation you will peek inside the inner workings of the docman tool and see: All the advantages it will bring to your multisite /single doc root deployments A real-world case study of setting up a stable platform using this concept and the tools needed A development process using docman ('docman build local development' command and others) Real-world example: You have a docroot at Acquia Cloud You have a small governance team setting up standards (Drupal core, list of contrib modules) You have 3 vendors working on three different websites in multisite environmentTRANSCRIPT
![Page 1: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/1.jpg)
http://corp.adyax.com/themes/adyax/logo.png
D E V O P S H T T P : / / B I T. LY / D O C M A N 2 0 1 4
DOCMAN
A L E K S E Y T K A C H E N K O A N D A L E K S A N D R T O L S T I K O V
The swiss army knife for Drupal multisite docroot management and deployment
![Page 2: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/2.jpg)
http://corp.adyax.com/themes/adyax/logo.png
WHO AM IOleksiy Tkachenko
With Drupal from 2007
With Adyax from 2009
PM, Drupal architect
France / Ukraine
![Page 3: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/3.jpg)
LARGEST DRUPAL SHOP IN EUROPE
350 PROJECTS150 DRUPALERS
7 YEARS OF GROWTH10K HOURS PROJECTS
![Page 4: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/4.jpg)
http://corp.adyax.com/themes/adyax/logo.pngBEFORE WE START
![Page 5: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/5.jpg)
/ VAR / WWW
Acquia: your docroot folder is the root-level of your Drupal installation and its websites and contains its files and directories, including Drupal's index.php, includes directory, and modules directory.
DOCROOT?
![Page 6: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/6.jpg)
PROBLEM 1:
Multiple suppliers need to work with one multisite installation
![Page 7: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/7.jpg)
PROBLEM 1:
Deployment is painful - fatal errors, incompatibility
Production environment - never stable
How to merge and integrate the work of multiple people?
How to merge and integrate the work of multiple teams?
![Page 8: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/8.jpg)
PROBLEM 2:
Standard modules, best practices and team discipline
![Page 9: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/9.jpg)
PROBLEM 2:
No development standards. Panels? Contexts?
Standards exists, but not respected
Drupal best-practices are not respected
Modules in /all or in /default?
No team discipline (features are overridden, environments omitted, etc)
![Page 10: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/10.jpg)
PROBLEM 3:
Governance
![Page 11: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/11.jpg)
PROBLEM 3:
Who should update Drupal?
What modules needs to be updated?
What is happening in my docroot?
What are the latest changes and stable versions?
![Page 12: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/12.jpg)
PROBLEM 4:
How and when?
![Page 13: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/13.jpg)
PROBLEM 4:
When to run tests?
How to run tests?
In which environment?
![Page 14: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/14.jpg)
PROBLEM 5:
Cloud hosting usually is very limited in multisite management
![Page 15: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/15.jpg)
INTRODUCING DOCMAN
# gem install docman
http://adyax.github.io/docman/
![Page 16: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/16.jpg)
SCHEMA
GIT:PROJECT
A
GIT: CORE GIT:
SITES
GIT: CLOUD HOOKS
DOCMAN
DOCROOT
GIT:PROJECT
B
GIT:COMMON
GIT:PROFILE
S
![Page 17: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/17.jpg)
REPOSITORIES: CONFIG
/masterconfig.yaml
|-- config.yaml (environments config)|-- master |-- info.yaml (Main docroot build config) |-- docroot | |-- info.yaml (Main docroot build config) | |-- after_build.sh (executed after build) | |-- profiles | |-- info.yaml (Projects dir build config) | |-- project_profile (if exists) | |-- info.yaml (Profile build config) | |-- after_build.sh (executed after build) | |-- projects | |-- info.yaml (Projects dir build config) | |-- project_code | |-- info.yaml (Code build config) | |-- after_build.sh (executed after build) | |-- sites | |-- info.yaml (Docroot sites dir build config) | |-- after_build.sh (executed after build) | |-- common | |-- info.yaml (SG core common files dir build config) | |-- after_build.sh (executed after build)
https://github.com/Adyax/docman-configTemplate:
![Page 18: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/18.jpg)
config.yaml
REPOSITORIES: CONFIG---environments: dev: deploy_target: git_target state: development target_checker: handler: :ssh file_path: /mnt/www/html/subscription_name_dev # Edit this! ssh_host: staging-xxxx.prod.hosting.acquia.com # Edit this! ssh_user: subscription_name # Edit this! test: deploy_target: git_target state: staging target_checker: handler: :ssh file_path: none file_path: /mnt/www/html/subscription_name_dev # Edit this! ssh_host: staging-xxxx.prod.hosting.acquia.com # Edit this! ssh_user: subscription_name # Edit this! prod: deploy_target: git_target state: stable tagger: enabled: true handler: :option
![Page 19: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/19.jpg)
master/common/info.yaml
REPOSITORIES: CONFIGstatus: enabledtype: reporepo: git@this-is-your-git-host:common/common.git # Edit this. This is your repository with common modules for everyone.order: 30states: # Git flow! development: type: branch version: develop staging: type: branch version: master stable: source: type: :retrieve_from_repo repo: :project_repo branch: state_stable file: info.yamlhooks: builder: after_execute: - type: :script location: $INFO$/after_build.sh execution_dir: $PROJECT$ params: - environment
Common code repo described
![Page 20: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/20.jpg)
master/docroot/info.yaml
REPOSITORIES: CONFIGtype: reporepo: git@this-is-your-git-host:common/drupal-core.git # This is your Drupal repo.order: 1states: development: type: branch version: master staging: type: branch version: master stable: type: branch version: masterhooks: builder: after_execute: - type: :script location: $INFO$/after_build.sh execution_dir: $PROJECT$ params: - environment
Drupal core repo described
![Page 21: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/21.jpg)
master/projects/project1/info.yaml
REPOSITORIES: CONFIGtype: reporepo: git@this-is-your-git-host:project1.git # Edit this. This is your project repository with custom code.states: development: type: branch version: develop staging: type: branch version: master stable: source: type: :retrieve_from_repo repo: :project_repo branch: state_stable file: info.yaml location: $PROJECT$/tools/deploy/$ENVIRONMENT$/after/after.sh execution_dir: $ROOT$/docroot params: - environment - type: :script location: $PROJECT$/tools/deploy/common/after/after.sh execution_dir: $ROOT$/docroot params: - environment
Project code repo described (not fully)
![Page 22: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/22.jpg)
Drupal 7
REPOSITORIES: CORE
Branches:developmaster
state_stable
![Page 23: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/23.jpg)
REPOSITORIES: SITES
SITES
/all/default/site_a/site_bsites.php
Branches:developmaster
state_stable
https://github.com/Adyax/docman-sites
![Page 24: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/24.jpg)
/modules/themes/libraries
REPOSITORIES: PROJECT
PROJECT A
Branches:developmaster
state_stable
https://github.com/Adyax/docman-project
![Page 25: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/25.jpg)
REPOSITORIES: CLOUD HOOKS
/common/dev/prod/samples/scripts/testREADME.md
![Page 26: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/26.jpg)
FEATURES
Focused on cloud hosting: Acquia Cloud, Pantheon and others, but not limited to.
Clear separation of the websites code in multisite environments
Incremental pushes of the finished docroot to the cloud hosting
Code separation for easy deployment
![Page 27: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/27.jpg)
FEATURES
Drupal version agnostic Drupal 8 ready!
Force people to keep features by default, updb, features revert, registry rebuild on each push to environments
IF SOMETHING HURTS, DO IT MORE OFTEN.
http://evan.bottch.com/2010/05/26/continuous-integration-if-something-hurts-do-it-more-often
![Page 28: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/28.jpg)
FEATURES
Multiple docroots to support? Not a problem!
Stable & versioned production environment
Jenkins friendly workflow
Deployment pipelines organisation (with Jenkins integration)http://www.infoq.com/minibooks/continuous-delivery-overview
Different deployment scenarios achievable through config: Continuous integration
Continuous deliveryContinuous deployment
![Page 29: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/29.jpg)
LOCAL ENVIRONMENT
# docman build local development
![Page 30: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/30.jpg)
DEV + STAGE ENVIRONMENT
# docman build git_target staging
# docman build git_target development
![Page 31: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/31.jpg)
LIVE ENVIRONMENT
# docman build git_target stable
![Page 32: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/32.jpg)
AVAILABLE COMMANDS
$ docman init <dir> <config-repo>
$ docman build <target> <env>
$ docman bump stable
![Page 33: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/33.jpg)
AVAILABLE HELPERS
CHANGELOG file in each repo automatically generated using commit comments
VERSION file in each repo automatically generated with the latest version (all branches)
info.yaml files everywhere helps you with what is what
![Page 34: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/34.jpg)
CASE STUDY 1: BEFORE
INITIAL CODEBASE
CLONE
SITE 2 CODEBASE SITE 3 CODEBASE
![Page 35: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/35.jpg)
CASE STUDY 1: PROBLEMS
Conflict with Features (modules) on the cloned website
Manual deployment for each website
Pain to maintain
Standards? Which one?
Code duplication
![Page 36: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/36.jpg)
CASE STUDY 1: AFTER
GIT:SITE A
GIT:SITE B
GIT: COREСOMMO
N
DOCROOT docman
gitGIT: SITES
![Page 37: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/37.jpg)
CASE STUDY 2: SERIOUS
Drupal is a company level standard for websites (yay!)
Global company
At least 3 different Drupal shops independently delivering websites constantly
![Page 38: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/38.jpg)
CASE STUDY 2: PROBLEMS
At least 3 different Drupal shops independently delivering websites.
Maintenance? Each agency defines.
Standards? Each agency defines. (Panels? Context?)
Deployment? Approach is different per agency (capistrano, manual, ftp, you name it).
Hosting is in the same place but each time configured differently
![Page 39: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/39.jpg)
CASE STUDY 2: SOLUTION
GIT:SITE A
GIT:SITE B
GIT: CORECOMMO
NGIT: SITES
GIT: CLOUD HOOKS
INTEGRATION PLATFORM
DOCROOT Acquia Cloud
git hooks >Jenkins > docman
Gitlab
![Page 40: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/40.jpg)
http://corp.adyax.com/themes/adyax/logo.pngDEMO TIME
![Page 41: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/41.jpg)
ROADMAP
@Todo: Vagrant image generation per website for easy local development
@Todo: wizard to generate repository with configs
@Todo: Documentation
![Page 42: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/42.jpg)
NEED HELP
@Todo: Config templates for various cloud hosting systems
@Todo: More deployment targets
@Todo: More docroot templates (Pantheon, Aberdeen Cloud, etc)
@Todo: Better config error handling
![Page 43: Multisite, multiple docroots & multiple agencies management for Drupal](https://reader035.vdocuments.net/reader035/viewer/2022070303/54923015ac79595e288b470e/html5/thumbnails/43.jpg)
http://corp.adyax.com/themes/adyax/logo.pngWHAT DID YOU THINK?
E V A L U AT E T H I S S E S S I O N - http://bit.ly/docman2014
FOLLOW US @ADYAX
FOLLOW ME @SHUMUSHIN