These slides were used in my presentation "Developing for Drupal 8 with Drupal VM", given at MidCamp in Chicago, IL on 2017-04-01.
Learn how to build a modern Drupal 8 website using Composer and Drupal VM for local and prod!
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
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!