FAQs
How to know which ahoy commands are available?
ahoy help
How to pass CLI arguments to commands?
ahoy mycommand -- myarg1 myarg2 --myoption1 --myoption2=myvalue
How to clear Drupal cache?
- Ahoy
- Docker Compose
ahoy drush cr
docker compose exec cli drush cr
How to login to a Drupal site?
- Ahoy
- Docker Compose
ahoy login
docker compose exec cli drush uli
How to connect to the database?
- Ahoy
- Docker Compose
If you have Sequel Ace:
ahoy db
Otherwise:
- Run
ahoy infoand grab the DB host port number. - Use the connection details below.
- Run
docker compose psand find the database port mapping. - Use the connection details below.
Connection details:
- Host:
127.0.0.1 - Username:
drupal - Password:
drupal - Database:
drupal - Port: the port from the step above
How to use Xdebug?
- Ahoy
- Docker Compose
- Run
ahoy debug. - Enable listening for incoming debug connections in your IDE.
- If required, provide server URL to your IDE as it appears in the browser.
- Enable Xdebug flag in the request coming from your web browser (use one of
the extensions or add
?XDEBUG_SESSION_START=1to your URL). - Set a breakpoint in your IDE and perform a request in the web browser.
Use the same commands to debug CLI scripts.
To disable, run ahoy up.
- Run
XDEBUG_ENABLE=true docker compose up -d cli php nginx. - Enable listening for incoming debug connections in your IDE.
- If required, provide server URL to your IDE as it appears in the browser.
- Enable Xdebug flag in the request coming from your web browser (use one of
the extensions or add
?XDEBUG_SESSION_START=1to your URL). - Set a breakpoint in your IDE and perform a request in the web browser.
Use the same commands to debug CLI scripts.
To disable, run docker compose up -d cli php nginx.
➡️ See Debugging
How to use Xdebug with Behat?
- Ahoy
- Docker Compose
- Enable debugging:
ahoy debug - Enter CLI container:
ahoy cli - Run Behat tests:
vendor/bin/behat --xdebug path/to/test.feature
- Enable debugging:
XDEBUG_ENABLE=true docker compose up -d cli php nginx - Enter CLI container:
docker compose exec cli bash - Run Behat tests:
vendor/bin/behat --xdebug path/to/test.feature
What should I do to switch to a "clean" branch environment?
Provided that your stack is already running:
- Ahoy
- Docker Compose
- Switch to your branch
composer installahoy provision
You do not need to rebuild the full stack using ahoy build every
time you switch branches. ahoy provision will update the environment
to match the current branch.
However, sometimes you would want to have an absolutely clean environment - in
that case, use ahoy build.
- Switch to your branch
docker compose exec cli composer installdocker compose exec cli ./scripts/vortex/provision.sh
You do not need to rebuild the full stack every time you switch branches. The provision script will update the environment to match the current branch.
However, sometimes you would want to have an absolutely clean environment - in that case, run:
docker compose down
./scripts/vortex/reset.sh
docker compose up -d --build --force-recreate
docker compose exec cli ./scripts/vortex/provision.sh
How to just import a database?
Provided that your stack is already running:
- Ahoy
- Docker Compose
ahoy import-db
ahoy import-db .data/db_custom.sql
docker compose exec cli ./scripts/vortex/import-db.sh
docker compose exec cli ./scripts/vortex/import-db.sh .data/db_custom.sql
How to add Drupal modules
- Ahoy
- Docker Compose
ahoy composer require drupal/module_name
docker compose exec cli composer require drupal/module_name
How to add patches for Drupal modules
-
Add
titleto patch on https://drupal.org to thepatchesarray inextrasection incomposer.json."extra": {
"patches": {
"drupal/somepackage": {
"Remote patch description": "https://www.drupal.org/files/issues/issue.patch"
"Local patch description": "patches/package-description.patch"
}
}
} -
Run
- Ahoy
- Docker Compose
ahoy composer require drupal/somepackage
docker compose exec cli composer require drupal/somepackage
➡️ See Composer > Patching
What should I do when Composer blocks package installation due to security vulnerabilities?
Starting with Composer 2.9.0, Composer can automatically block the installation or update of packages with known security vulnerabilities. If you encounter this issue, you have several options:
- Update the affected packages: Try updating to newer versions that don't
have known vulnerabilities:
composer update vendor/package-name - Review the vulnerability: Run
composer auditto see details about the security issues and determine if they affect your project. - Adjust security settings: If you need to proceed with installation despite
warnings (for example, if no secure version is available or the vulnerability
doesn't affect your use case), you can configure the
audit.block-insecuresetting in yourcomposer.json.
➡️ See Composer > Security auditing for detailed
information about the audit configuration option and guidance on choosing the
right security settings for your project.
How to set a custom maintenance theme?
To set a custom theme for Drupal's maintenance mode (when the site is offline
for updates), set the DRUPAL_MAINTENANCE_THEME environment variable:
# In .env file
DRUPAL_MAINTENANCE_THEME=my_custom_theme
This theme will be used when Drupal is in maintenance mode. If
DRUPAL_MAINTENANCE_THEME is not set, the system will fall back to using the
value of DRUPAL_THEME.
The maintenance theme should be a valid Drupal theme that is already installed and enabled on your site.
Behat tests with @javascript tag sometimes get stuck
Behat tests with @javascript tag sometimes get stuck for about 10min then
fail. The Chrome container randomly gets stuck for an unknown reason.
Restart the Chrome container: docker compose restart chrome