Skip to main content

Drush

https://www.drush.org/

Drush is a command line shell and Unix scripting interface for Drupal. Drush core ships with lots of useful commands and generators. Similarly, it runs update.php, executes SQL queries, runs content migrations, and misc utilities like cron or cache rebuild. Drush can be extended by 3rd party commandfiles.

Drush is used throughout Vortex to interact with Drupal from the workflow scripts and Behat tests.

It also allows a developer to interact with the site via CLI during development.

While all the standard Drush commands supported, Vortex also provides some shorthand commands to abstract some of the common tasks:

  • downloading the database dump from the remote environment
  • importing the database dump into the local environment
  • running database updates and clearing caches

See workflows for more details.

Usage

Drush should be used from the inside of the container.

ahoy drush <command>

Aliases

For Lagoon hosting, Drush site aliases are automatically generated for each environment and can be used either from the host machine or from within the container.

  1. Make sure your SSH key is loaded in your ssh-agent:
ssh-add ~/.ssh/path/to/key
  1. Run Drush commands using the Lagoon site aliases:
drush @lagoon.develop status  # Show status of the develop environment
drush @lagoon.pr-123 ssh # SSH into the web container of the PR-123 environment