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: ConďŹgure Behat (behat.yml)
⢠Add tests directory
⢠Copy the conďŹg 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 ďŹles 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
⢠ConďŹgure ALL THE THINGS in VagrantďŹle.local
⢠Add custom pre/post-provision playbooks
⢠Test your modules with PAReview.sh
BONUS ROUND!