Drush
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
- Docker Compose
ahoy drush <command>
docker compose exec cli 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.
- Host
- Ahoy
- Docker Compose
- Make sure your SSH key is loaded in your
ssh-agent
:
ssh-add ~/.ssh/path/to/key
- 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
- Make sure your SSH key is loaded into
pygmy
:
pygmy addkey --key ~/.ssh/path/to/key
- Run Drush commands using the Lagoon site aliases:
ahoy drush @lagoon.develop status # Show status of the develop environment
ahoy drush @lagoon.pr-123 ssh # SSH into the web container of the PR-123 environment
- Make sure your SSH key is loaded into
pygmy
:
pygmy addkey --key ~/.ssh/path/to/key
- Run Drush commands using the Lagoon site aliases:
docker compose exec cli drush drush @lagoon.develop status # Show status of the develop environment
docker compose exec cli drush drush @lagoon.pr-123 ssh # SSH into the web container of the PR-123 environment