Skip to content

Instantly share code, notes, and snippets.

@mortenson
Last active March 20, 2022 09:51
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mortenson/1080f7bc55285ec2e811a676363927d6 to your computer and use it in GitHub Desktop.
Save mortenson/1080f7bc55285ec2e811a676363927d6 to your computer and use it in GitHub Desktop.
What I currently use for local Drupal/Tome dev
#! /bin/bash
# This runs a new Docker container, mounts the current directory (Drupal root),
# and runs an arbitrary drush command, in case you don't want to run it in dsession.
sudo docker run --rm -it --init -v "$(pwd)":/var/www/tome mortenson/tome drush "$@"
#!/bin/bash
# This runs a new Docker container, mounts the current directory (Drupal root),
# runs a Drush server, then pops you into a bash session so you can run more
# Drush/composer commands. Usage: dsession
sudo docker run --rm -it -p 8888:8888 -v "$(pwd)":/var/www/tome mortenson/tome bash -c "drush runserver 0.0.0.0:8888 & sleep 2 && bash"
#!/bin/bash
# This runs a new Docker container, mounts the current directory (Drupal root),
# runs a Drush server, runs a chromedriver instance, and executes the PHPUnit
# test you provide it with. Usage: dtest <path to test>
sudo docker run --rm -it --init -p 8889:8889 --env "SIMPLETEST_DB=sqlite://localhost/.test.sqlite" --env "SIMPLETEST_BASE_URL=http://127.0.0.1:8889" -v "$(pwd)":/var/www/tome mortenson/tome bash -c "drush runserver 8889 & chromedriver --port=4444 & sleep 2 && ./vendor/bin/phpunit -c core $@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment