SlideShare a Scribd company logo
1 of 41
Download to read offline
DRUPAL VM
A VM for Drupal development, built with Vagrant + Ansible
★
#MidCamp 2017 – Jeff Geerling
@geerlingguy
• Drupalist
...of genus Acquian
• Writer
• Automator of things
DRUPAL VM
• Info: www.drupalvm.com
• Docs: docs.drupalvm.com
• Code: GitHub
DRUPAL VM
• Quick Start:
1. Install VirtualBox and Vagrant
2. Download Drupal VM
3. vagrant up
HOW DO I BUILD AND
MAINTAIN DRUPAL 8
PROJECTS?
Drush was never designed as a
dependency management tool.
❤
DRUPAL-PROJECT
$ composer create-project drupal-composer/drupal-project:8.x-dev 
bacon 
--stability dev 
--no-interaction
DRUPAL VM
composer require --dev geerlingguy/drupal-vm
PREP THE VM
---
vagrant_hostname: local.bacon.com
drupal_build_composer_project: false
drupal_build_composer: false
drupal_composer_dependencies: []
installed_extras:
- drush
- drupalconsole
- mailhog
- nodejs
- xdebug
- varnish
vm/config.yml
{
PREP DRUPAL PROJECT
ENV['DRUPALVM_PROJECT_ROOT'] = "#{__dir__}"
ENV['DRUPALVM_CONFIG_DIR'] = "vm"
ENV['DRUPALVM_DIR'] = "vendor/geerlingguy/drupal-vm"
# Load Drupal VM's Vagrantfile
load "#{__dir__}/#{ENV['DRUPALVM_DIR']}/Vagrantfile"
Vagrantfile
{
vagrant up
WHAT ABOUT PROD?
WHAT ABOUT PROD?
---
# Deploy from the project's Git repository.
drupal_deploy: true
drupal_deploy_repo: "git@github.com:my/bacon.git"
drupal_deploy_dir: /var/www/drupal
# Set the domain for this site appropriately.
drupal_domain: "prod.bacon.com"
vagrant_hostname: "{{ drupal_domain }}"
vm/prod.config.yml
{
WHAT ABOUT PROD?
$ DRUPALVM_ENV=prod 

ansible-playbook -i vm/inventory 

vendor/geerlingguy/drupal-vm/provisioning/playbook.yml 

-e "config_dir=$(pwd)/vm" 

--become --ask-become-pass 

--ask-vault-pass
WHAT ABOUT PROD?
• Dogfooding: project is on GitHub
• Everybody loves secrets (.yml)
• Full writeup on my blog:

https://www.jeffgeerling.com/drupal-vm-local-prod
GOING DEEPER
EXAMPLE: SOLR SEARCH
EXAMPLE: SOLR SEARCH
• Step 1: Add Solr to Drupal VM
• Add solr to installed_extras
• Copy Drupal VM's example configure-solr.sh
to scripts/configure-solr.sh
• Add script to vm/config.yml:
post_provision_scripts:

- "../../../../scripts/configure-solr.sh"
EXAMPLE: SOLR SEARCH
• Step 2: Add Drupal modules
composer require drupal/search_api:^1.0
drupal/search_api_solr:^1.0
drush @local.example.com en -y search_api
search_api_solr search_api_solr_defaults
EXAMPLE: SOLR SEARCH
• Step 3: Export the config and deploy!
• Disable Search API Solr Defaults module
• Export: drush @local.bacon.com cex -y
• Commit and push
• Deploy: Run the playbook on prod!
It's alive!!!
EXAMPLE: BEHAT TESTS
EXAMPLE: BEHAT TESTS
EXAMPLE: BEHAT TESTS
• Step 1: Add Selenium to Drupal VM
• Add selenium to installed_extras
EXAMPLE: BEHAT TESTS
• Step 2: Add Drupal Extension
composer require --dev drupal/drupal-extension
EXAMPLE: BEHAT TESTS
• Step 3: Configure Behat (behat.yml)
• Add tests directory
• Copy the config from Drupal VM's docs
• Paste into new tests/behat.yml
EXAMPLE: BEHAT TESTS
• Step 4: Initialize Behat
• Log into VM
• cd into tests
• Run ../vendor/bin/behat init
EXAMPLE: BEHAT TESTS
• Step 5: Test ALL THE THINGS!
• Create feature files in tests/features/web
• Example: HomeContent.feature
EXAMPLE: BEHAT TESTS
Feature: Test DrupalContext
In order to prove Behat is working correctly in Drupal VM

As a developer

I need to run a simple interface test
Scenario: Viewing content in a region

Given I am on the homepage

Then I should see "This is a demonstration" in the "content"
EXAMPLE: BEHAT TESTS
WINDOWS
WINDOWS
😭
WINDOWS
🤗
WINDOWS
• Use SMB, rsync, or reverse-mount shared folders
• Use WSL/Ubuntu Bash and/or Cmder
• Use Unix line endings
• Read the docs
• DRUPALVM_ANSIBLE_TAGS=xdebug vagrant provision
• Tideways is the new XHProf
• Configure ALL THE THINGS in Vagrantfile.local
• Add custom pre/post-provision playbooks
• Test your modules with PAReview.sh
BONUS ROUND!
THE FUTURE
• Docker & Libvirt/KVM
• Easier config template customization
• Certbot + LetsEncrypt (TLS FTW)
• MOAR Composer
• MOAR Windows
THANKS!
• Review this session:

https://joind.in/talk/8f8fa
• Support my work on Patreon:

https://www.patreon.com/geerlingguy

More Related Content

What's hot

What's hot (20)

SEP DevOps Ignite Talk - Packer
SEP DevOps Ignite Talk - PackerSEP DevOps Ignite Talk - Packer
SEP DevOps Ignite Talk - Packer
 
Ansible Case Studies
Ansible Case StudiesAnsible Case Studies
Ansible Case Studies
 
What's New in v2 - AnsibleFest London 2015
What's New in v2 - AnsibleFest London 2015What's New in v2 - AnsibleFest London 2015
What's New in v2 - AnsibleFest London 2015
 
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance Drupal
 
Ansible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeAnsible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less Coffee
 
macos installation automation
macos installation automationmacos installation automation
macos installation automation
 
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Ansible v2 and Beyond (Ansible Hawai'i Meetup)Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
 
Docker slides
Docker slidesDocker slides
Docker slides
 
EC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and PackerEC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and Packer
 
Deploying PHP Applications with Ansible
Deploying PHP Applications with AnsibleDeploying PHP Applications with Ansible
Deploying PHP Applications with Ansible
 
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
 
Ansible and AWS
Ansible and AWSAnsible and AWS
Ansible and AWS
 
How Ansible Makes Automation Easy
How Ansible Makes Automation EasyHow Ansible Makes Automation Easy
How Ansible Makes Automation Easy
 
Ansible + WordPress
Ansible + WordPressAnsible + WordPress
Ansible + WordPress
 
Ansible - A 'crowd' introduction
Ansible - A 'crowd' introductionAnsible - A 'crowd' introduction
Ansible - A 'crowd' introduction
 
Ansible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL MeetupAnsible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL Meetup
 
Cyansible
CyansibleCyansible
Cyansible
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 
Vagrant to-aws-flow
Vagrant to-aws-flowVagrant to-aws-flow
Vagrant to-aws-flow
 
Ansible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers GaliciaAnsible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers Galicia
 

Viewers also liked

Amazon EC2 HPCインスタンス - AWSマイスターシリーズ
Amazon EC2 HPCインスタンス - AWSマイスターシリーズAmazon EC2 HPCインスタンス - AWSマイスターシリーズ
Amazon EC2 HPCインスタンス - AWSマイスターシリーズ
Amazon Web Services Japan
 

Viewers also liked (20)

Xpert MTB/RIF Ultra newer technology past to future DIAGNOSIS OF TUBERCULOSIS
Xpert MTB/RIF Ultranewer technologypast to future DIAGNOSIS OF TUBERCULOSIS Xpert MTB/RIF Ultranewer technologypast to future DIAGNOSIS OF TUBERCULOSIS
Xpert MTB/RIF Ultra newer technology past to future DIAGNOSIS OF TUBERCULOSIS
 
Alejandro Fernandez vs Luis Miguel
Alejandro Fernandez vs Luis MiguelAlejandro Fernandez vs Luis Miguel
Alejandro Fernandez vs Luis Miguel
 
マイクロソフトが創る未来 医療編 20170401
マイクロソフトが創る未来 医療編 20170401マイクロソフトが創る未来 医療編 20170401
マイクロソフトが創る未来 医療編 20170401
 
Elixir-Conf-Japan-2017-session-ohr486
Elixir-Conf-Japan-2017-session-ohr486Elixir-Conf-Japan-2017-session-ohr486
Elixir-Conf-Japan-2017-session-ohr486
 
トレンドを探る AI と HPC の関係性
トレンドを探る AI と HPC の関係性トレンドを探る AI と HPC の関係性
トレンドを探る AI と HPC の関係性
 
La teoría PDCA para la mejora contínua
La teoría PDCA para la mejora contínuaLa teoría PDCA para la mejora contínua
La teoría PDCA para la mejora contínua
 
Thank you 4.1.2017
Thank you 4.1.2017Thank you 4.1.2017
Thank you 4.1.2017
 
Amazon EC2 HPCインスタンス - AWSマイスターシリーズ
Amazon EC2 HPCインスタンス - AWSマイスターシリーズAmazon EC2 HPCインスタンス - AWSマイスターシリーズ
Amazon EC2 HPCインスタンス - AWSマイスターシリーズ
 
Immunisation against bacteria
Immunisation against bacteriaImmunisation against bacteria
Immunisation against bacteria
 
Mr. Nitin bassi IEWP @ 2nd India-EU Water Forum @ World Sustainable Developme...
Mr. Nitin bassi IEWP @ 2nd India-EU Water Forum @ World Sustainable Developme...Mr. Nitin bassi IEWP @ 2nd India-EU Water Forum @ World Sustainable Developme...
Mr. Nitin bassi IEWP @ 2nd India-EU Water Forum @ World Sustainable Developme...
 
PROCESO DE EXPORTACION DE AGUACATE HASS
PROCESO DE EXPORTACION DE AGUACATE HASSPROCESO DE EXPORTACION DE AGUACATE HASS
PROCESO DE EXPORTACION DE AGUACATE HASS
 
[JDLL 2017] Le Guide du Connard du Logiciel Libre
[JDLL 2017] Le Guide du Connard du Logiciel Libre[JDLL 2017] Le Guide du Connard du Logiciel Libre
[JDLL 2017] Le Guide du Connard du Logiciel Libre
 
2017 HE sytem in Lebanon
2017 HE sytem in Lebanon 2017 HE sytem in Lebanon
2017 HE sytem in Lebanon
 
20170330 lckva pfi gwp presentatie grondstoffencongres 2017
20170330 lckva pfi gwp presentatie grondstoffencongres 201720170330 lckva pfi gwp presentatie grondstoffencongres 2017
20170330 lckva pfi gwp presentatie grondstoffencongres 2017
 
o discípulo e a oração
o discípulo e a oraçãoo discípulo e a oração
o discípulo e a oração
 
Daniela Bandera Distinte e Integrate 31032017
Daniela Bandera Distinte e Integrate 31032017Daniela Bandera Distinte e Integrate 31032017
Daniela Bandera Distinte e Integrate 31032017
 
Transform your living space into beauty.
Transform your living space into beauty.Transform your living space into beauty.
Transform your living space into beauty.
 
Мастер класс "Команда о которой вы мечтаете"
Мастер класс "Команда о которой вы мечтаете"Мастер класс "Команда о которой вы мечтаете"
Мастер класс "Команда о которой вы мечтаете"
 
Zły UX. Dlaczego dostajemy 
słabe produkty i usługi?
Zły UX. Dlaczego dostajemy 
słabe produkty i usługi?Zły UX. Dlaczego dostajemy 
słabe produkty i usługi?
Zły UX. Dlaczego dostajemy 
słabe produkty i usługi?
 
Jc aprile 2017
Jc aprile 2017Jc aprile 2017
Jc aprile 2017
 

Similar to Drupal VM for Drupal 8 Dev - MidCamp 2017

Docker at Monoco.jp (LinkedIn)
Docker at Monoco.jp (LinkedIn)Docker at Monoco.jp (LinkedIn)
Docker at Monoco.jp (LinkedIn)
Akhmad Fathonih
 
Modernize Your Drupal Development
Modernize Your Drupal DevelopmentModernize Your Drupal Development
Modernize Your Drupal Development
Chris Tankersley
 

Similar to Drupal VM for Drupal 8 Dev - MidCamp 2017 (20)

Vagrant crash course
Vagrant crash courseVagrant crash course
Vagrant crash course
 
Drupal 8 - Improving your development workflow
Drupal 8 - Improving your development workflowDrupal 8 - Improving your development workflow
Drupal 8 - Improving your development workflow
 
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
 
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...
 
Docker at Monoco.jp (LinkedIn)
Docker at Monoco.jp (LinkedIn)Docker at Monoco.jp (LinkedIn)
Docker at Monoco.jp (LinkedIn)
 
Using Minikube for Node.js development
Using Minikube for Node.js developmentUsing Minikube for Node.js development
Using Minikube for Node.js development
 
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
 
Drupal 8 improvements for developer productivity php symfony and more
Drupal 8 improvements for developer productivity  php symfony and moreDrupal 8 improvements for developer productivity  php symfony and more
Drupal 8 improvements for developer productivity php symfony and more
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composer
 
Detailed Introduction To Docker
Detailed Introduction To DockerDetailed Introduction To Docker
Detailed Introduction To Docker
 
Vagrant and puppet: Deployment made easy
Vagrant and puppet: Deployment made easyVagrant and puppet: Deployment made easy
Vagrant and puppet: Deployment made easy
 
Modernize Your Drupal Development
Modernize Your Drupal DevelopmentModernize Your Drupal Development
Modernize Your Drupal Development
 
How to deploy and run mule in docker
How to deploy and run mule in dockerHow to deploy and run mule in docker
How to deploy and run mule in docker
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composer
 
Enabling Hybrid Workflows with Docker/Mesos @Orbitz
Enabling Hybrid Workflows with Docker/Mesos @OrbitzEnabling Hybrid Workflows with Docker/Mesos @Orbitz
Enabling Hybrid Workflows with Docker/Mesos @Orbitz
 
Dockerize All The Things
Dockerize All The ThingsDockerize All The Things
Dockerize All The Things
 
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
Help! I inherited a Drupal Site! - DrupalCamp Atlanta 2016
 
vodQA(Pune) 2018 - Docker in Testing
vodQA(Pune) 2018 - Docker in TestingvodQA(Pune) 2018 - Docker in Testing
vodQA(Pune) 2018 - Docker in Testing
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
CI/CD with Azure DevOps and Azure Databricks
CI/CD with Azure DevOps and Azure DatabricksCI/CD with Azure DevOps and Azure Databricks
CI/CD with Azure DevOps and Azure Databricks
 

More from Jeff Geerling

More from Jeff Geerling (14)

Continuous Testing with Molecule, Ansible, and GitHub Actions
Continuous Testing with Molecule, Ansible, and GitHub ActionsContinuous Testing with Molecule, Ansible, and GitHub Actions
Continuous Testing with Molecule, Ansible, and GitHub Actions
 
2020 Drupal Local Development Tools Survey - CMS Philly
2020 Drupal Local Development Tools Survey - CMS Philly2020 Drupal Local Development Tools Survey - CMS Philly
2020 Drupal Local Development Tools Survey - CMS Philly
 
There's a role for that! (AnsibleFest 2019)
There's a role for that! (AnsibleFest 2019)There's a role for that! (AnsibleFest 2019)
There's a role for that! (AnsibleFest 2019)
 
Everything I know about Kubernetes I learned from a Raspberry Pi cluster
Everything I know about Kubernetes I learned from a Raspberry Pi clusterEverything I know about Kubernetes I learned from a Raspberry Pi cluster
Everything I know about Kubernetes I learned from a Raspberry Pi cluster
 
Real World DevOps - Jeff Geerling's NEDCamp 2018 Keynote
Real World DevOps - Jeff Geerling's NEDCamp 2018 KeynoteReal World DevOps - Jeff Geerling's NEDCamp 2018 Keynote
Real World DevOps - Jeff Geerling's NEDCamp 2018 Keynote
 
Make your Ansible playbooks maintainable, flexible, and scalable
Make your Ansible playbooks maintainable, flexible, and scalableMake your Ansible playbooks maintainable, flexible, and scalable
Make your Ansible playbooks maintainable, flexible, and scalable
 
Ansible and Kubernetes
Ansible and KubernetesAnsible and Kubernetes
Ansible and Kubernetes
 
HTTPS and Ansible
HTTPS and AnsibleHTTPS and Ansible
HTTPS and Ansible
 
ProTips for Staying Sane while Working from Home
ProTips for Staying Sane while Working from Home ProTips for Staying Sane while Working from Home
ProTips for Staying Sane while Working from Home
 
Highly available Drupal on a Raspberry Pi cluster
Highly available Drupal on a Raspberry Pi clusterHighly available Drupal on a Raspberry Pi cluster
Highly available Drupal on a Raspberry Pi cluster
 
Drupal 8 - A Brief Introduction
Drupal 8 - A Brief IntroductionDrupal 8 - A Brief Introduction
Drupal 8 - A Brief Introduction
 
Server Check.in case study - Drupal and Node.js
Server Check.in case study - Drupal and Node.jsServer Check.in case study - Drupal and Node.js
Server Check.in case study - Drupal and Node.js
 
Florissant TIF - Cross Keys Redevelopment
Florissant TIF - Cross Keys RedevelopmentFlorissant TIF - Cross Keys Redevelopment
Florissant TIF - Cross Keys Redevelopment
 
How to Build a Drupal Module
How to Build a Drupal ModuleHow to Build a Drupal Module
How to Build a Drupal Module
 

Recently uploaded

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Recently uploaded (20)

Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
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
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 

Drupal VM for Drupal 8 Dev - MidCamp 2017

  • 1. DRUPAL VM A VM for Drupal development, built with Vagrant + Ansible ★ #MidCamp 2017 – Jeff Geerling
  • 2. @geerlingguy • Drupalist ...of genus Acquian • Writer • Automator of things
  • 3.
  • 4. DRUPAL VM • Info: www.drupalvm.com • Docs: docs.drupalvm.com • Code: GitHub
  • 5. DRUPAL VM • Quick Start: 1. Install VirtualBox and Vagrant 2. Download Drupal VM 3. vagrant up
  • 6. HOW DO I BUILD AND MAINTAIN DRUPAL 8 PROJECTS?
  • 7. Drush was never designed as a dependency management tool.
  • 8.
  • 9. DRUPAL-PROJECT $ composer create-project drupal-composer/drupal-project:8.x-dev bacon --stability dev --no-interaction
  • 10. DRUPAL VM composer require --dev geerlingguy/drupal-vm
  • 11. PREP THE VM --- vagrant_hostname: local.bacon.com drupal_build_composer_project: false drupal_build_composer: false drupal_composer_dependencies: [] installed_extras: - drush - drupalconsole - mailhog - nodejs - xdebug - varnish vm/config.yml {
  • 12. PREP DRUPAL PROJECT ENV['DRUPALVM_PROJECT_ROOT'] = "#{__dir__}" ENV['DRUPALVM_CONFIG_DIR'] = "vm" ENV['DRUPALVM_DIR'] = "vendor/geerlingguy/drupal-vm" # Load Drupal VM's Vagrantfile load "#{__dir__}/#{ENV['DRUPALVM_DIR']}/Vagrantfile" Vagrantfile {
  • 15. WHAT ABOUT PROD? --- # Deploy from the project's Git repository. drupal_deploy: true drupal_deploy_repo: "git@github.com:my/bacon.git" drupal_deploy_dir: /var/www/drupal # Set the domain for this site appropriately. drupal_domain: "prod.bacon.com" vagrant_hostname: "{{ drupal_domain }}" vm/prod.config.yml {
  • 16. WHAT ABOUT PROD? $ DRUPALVM_ENV=prod 
 ansible-playbook -i vm/inventory 
 vendor/geerlingguy/drupal-vm/provisioning/playbook.yml 
 -e "config_dir=$(pwd)/vm" 
 --become --ask-become-pass 
 --ask-vault-pass
  • 17. WHAT ABOUT PROD? • Dogfooding: project is on GitHub • Everybody loves secrets (.yml) • Full writeup on my blog:
 https://www.jeffgeerling.com/drupal-vm-local-prod
  • 18.
  • 21. EXAMPLE: SOLR SEARCH • Step 1: Add Solr to Drupal VM • Add solr to installed_extras • Copy Drupal VM's example configure-solr.sh to scripts/configure-solr.sh • Add script to vm/config.yml: post_provision_scripts:
 - "../../../../scripts/configure-solr.sh"
  • 22. EXAMPLE: SOLR SEARCH • Step 2: Add Drupal modules composer require drupal/search_api:^1.0 drupal/search_api_solr:^1.0 drush @local.example.com en -y search_api search_api_solr search_api_solr_defaults
  • 23. EXAMPLE: SOLR SEARCH • Step 3: Export the config and deploy! • Disable Search API Solr Defaults module • Export: drush @local.bacon.com cex -y • Commit and push • Deploy: Run the playbook on prod!
  • 24.
  • 28. EXAMPLE: BEHAT TESTS • Step 1: Add Selenium to Drupal VM • Add selenium to installed_extras
  • 29. EXAMPLE: BEHAT TESTS • Step 2: Add Drupal Extension composer require --dev drupal/drupal-extension
  • 30. EXAMPLE: BEHAT TESTS • Step 3: Configure Behat (behat.yml) • Add tests directory • Copy the config from Drupal VM's docs • Paste into new tests/behat.yml
  • 31. EXAMPLE: BEHAT TESTS • Step 4: Initialize Behat • Log into VM • cd into tests • Run ../vendor/bin/behat init
  • 32. EXAMPLE: BEHAT TESTS • Step 5: Test ALL THE THINGS! • Create feature files in tests/features/web • Example: HomeContent.feature
  • 33. EXAMPLE: BEHAT TESTS Feature: Test DrupalContext In order to prove Behat is working correctly in Drupal VM
 As a developer
 I need to run a simple interface test Scenario: Viewing content in a region
 Given I am on the homepage
 Then I should see "This is a demonstration" in the "content"
  • 38. WINDOWS • Use SMB, rsync, or reverse-mount shared folders • Use WSL/Ubuntu Bash and/or Cmder • Use Unix line endings • Read the docs
  • 39. • DRUPALVM_ANSIBLE_TAGS=xdebug vagrant provision • Tideways is the new XHProf • Configure ALL THE THINGS in Vagrantfile.local • Add custom pre/post-provision playbooks • Test your modules with PAReview.sh BONUS ROUND!
  • 40. THE FUTURE • Docker & Libvirt/KVM • Easier config template customization • Certbot + LetsEncrypt (TLS FTW) • MOAR Composer • MOAR Windows
  • 41. THANKS! • Review this session:
 https://joind.in/talk/8f8fa • Support my work on Patreon:
 https://www.patreon.com/geerlingguy