Version 1.0
Improving your Development
workflow.
Development practices for a consistent experience.
Malabya Tewari
Drupal.org: https://www.drupal.org/u/imalabya
LinkedIn: https://www.linkedin.com/in/malabyatewari/
Version 1.0
Agenda
Codebase
Local development
Composer workflow
Deployment
Codebase
● One Codebase per application/site.
● Tracked by a version control (Git or other version control)
● Many deploys (dev, staging & production)
Codebase
Production
Staging
Development
Local
Codebase
Local Development
1 Mamp/Xamp/Lamp local setup
A local setup of Apache/Nginx, PHP, MySQL, etc
2 Vagrant/VM
An expendable virtual machine to build and
develop your apps with LAMP/LEMP installed
and other tools
3 Docker
Similar to VM but running containers to serve
your apps in a lightweight environments
4 Lando/Docksal/DDev
Applications to run containers or VMs for an
easy setup
Vagrant
Vagrant is an open-source software
product for building and maintaining
portable virtual software development
environments
Vagrant
1 Drupal VM
Ansible powered configurable VMs by Jeef
Geerling
2 Vagrant Boxes
Thousands of preconfigured boxes to start with
3 Scotch Box
A simple vagrant box for developers
4 Customized Boxes
Create your own box according to your need
Docker
Docker is an open platform for
developers and sysadmins to build, ship,
and run distributed applications,
whether on laptops, data center VMs, or
the cloud.
Docker
1 Lando
Lando is for developers who want to quickly
specify and painlessly spin up the services and
tools needed to develop their projects.
2 Dockersal
Docksal is a tool for defining and managing
development environments.
3 DDev
DDev is an open source tool that makes it dead
simple to get local PHP development
environments up and running within minutes.
4 Wodby Docker4Drupal
Docker4Drupal is a set of docker images
optimized for Drupal.
Composer
workflow
Application dependencies
● Declare and install dependencies via a
manifest files (composer.json)
● Use the dependency manager
appropriated to the
language/framework(composer, npm,
yarm, etc)
Composer
Drush make is dead,
Long live composer
Composer
Composer can be used to download Drupal, Drupal contributed
projects (modules, themes, etc.) and all of their respective
dependencies. These instructions vary based on your approach to
managing your Drupal installation.
● drupal-composer/drupal-project
● hussainweb/drupal-composer-init
● drupal/drupal
Composer workflow
● composer create-project drupal-composer/drupal-project:8.x-dev 
example --stability dev --no-interaction
● composer require drupal/devel
● composer require --dev drupal/devel
● composer install --no-dev
Composer workflow
● composer require cweagans/composer-patches
● "extra": {
"patches": {
"drupal/devel": {
"2860796: Create a branch of devel compatible with Media in core":
"https://www.drupal.org/files/issues/2860796-2.patch"
}
}
}
● composer update drupal/devel
● composer remove drupal/devel
● composer config platform.php 7.1
Deployment
Deployment
If you are not using Git, use it
If you are not using any version control
system, God save you
Configuration Management
● Manages your site’s configurations
● All the configurations stays in codebase
● Better option is to put the config folder
outside Drupal root
Gitignore
● Core directory
● Contributed modules
● Contributed themes
● Contributed profiles
● CSS files
● Vendor
Why ignore?
● Diff file is small
● Easy to review
● Can’t hack core
Deployment process commands
● git pull origin master
● composer install
● drush update-database -y
● drush config-import -y
● drush cache-rebuild
Thank you.

Drupal 8 - Improving your development workflow

  • 1.
    Version 1.0 Improving yourDevelopment workflow. Development practices for a consistent experience. Malabya Tewari Drupal.org: https://www.drupal.org/u/imalabya LinkedIn: https://www.linkedin.com/in/malabyatewari/
  • 2.
  • 3.
    Codebase ● One Codebaseper application/site. ● Tracked by a version control (Git or other version control) ● Many deploys (dev, staging & production)
  • 4.
  • 5.
    Local Development 1 Mamp/Xamp/Lamplocal setup A local setup of Apache/Nginx, PHP, MySQL, etc 2 Vagrant/VM An expendable virtual machine to build and develop your apps with LAMP/LEMP installed and other tools 3 Docker Similar to VM but running containers to serve your apps in a lightweight environments 4 Lando/Docksal/DDev Applications to run containers or VMs for an easy setup
  • 6.
    Vagrant Vagrant is anopen-source software product for building and maintaining portable virtual software development environments
  • 7.
    Vagrant 1 Drupal VM Ansiblepowered configurable VMs by Jeef Geerling 2 Vagrant Boxes Thousands of preconfigured boxes to start with 3 Scotch Box A simple vagrant box for developers 4 Customized Boxes Create your own box according to your need
  • 8.
    Docker Docker is anopen platform for developers and sysadmins to build, ship, and run distributed applications, whether on laptops, data center VMs, or the cloud.
  • 9.
    Docker 1 Lando Lando isfor developers who want to quickly specify and painlessly spin up the services and tools needed to develop their projects. 2 Dockersal Docksal is a tool for defining and managing development environments. 3 DDev DDev is an open source tool that makes it dead simple to get local PHP development environments up and running within minutes. 4 Wodby Docker4Drupal Docker4Drupal is a set of docker images optimized for Drupal.
  • 10.
  • 11.
    Application dependencies ● Declareand install dependencies via a manifest files (composer.json) ● Use the dependency manager appropriated to the language/framework(composer, npm, yarm, etc)
  • 12.
    Composer Drush make isdead, Long live composer
  • 13.
    Composer Composer can beused to download Drupal, Drupal contributed projects (modules, themes, etc.) and all of their respective dependencies. These instructions vary based on your approach to managing your Drupal installation. ● drupal-composer/drupal-project ● hussainweb/drupal-composer-init ● drupal/drupal
  • 14.
    Composer workflow ● composercreate-project drupal-composer/drupal-project:8.x-dev example --stability dev --no-interaction ● composer require drupal/devel ● composer require --dev drupal/devel ● composer install --no-dev
  • 15.
    Composer workflow ● composerrequire cweagans/composer-patches ● "extra": { "patches": { "drupal/devel": { "2860796: Create a branch of devel compatible with Media in core": "https://www.drupal.org/files/issues/2860796-2.patch" } } } ● composer update drupal/devel ● composer remove drupal/devel ● composer config platform.php 7.1
  • 16.
  • 17.
    Deployment If you arenot using Git, use it If you are not using any version control system, God save you
  • 18.
    Configuration Management ● Managesyour site’s configurations ● All the configurations stays in codebase ● Better option is to put the config folder outside Drupal root
  • 19.
    Gitignore ● Core directory ●Contributed modules ● Contributed themes ● Contributed profiles ● CSS files ● Vendor
  • 20.
    Why ignore? ● Difffile is small ● Easy to review ● Can’t hack core
  • 21.
    Deployment process commands ●git pull origin master ● composer install ● drush update-database -y ● drush config-import -y ● drush cache-rebuild
  • 22.