Skip to main content

Provision the site

provision installs Drupal with your extension enabled on the codebase that assemble built. It prints a one-time login link when it finishes. This page covers what provision does, where the database lives and how to run Drush and log in.

To get a clean site without reassembling the codebase, run provision on its own:

make provision

What it does​

provision runs these steps in order:

  1. Installs Drupal from the standard profile into a fresh SQLite database, with an admin account and no Update Status module. To install from another profile, set DRUPAL_PROFILE in your shell or .env to its machine name, such as minimal (see Environment variables).
  2. Enables your extension, as a module or as a theme.
  3. Rebuilds the caches.
  4. Enables each drupal/* extension in the suggest section of your composer.json, as a module or as a theme (see Optional dependencies).
  5. Requests the front page once, so the caches are warm before you open the site.
  6. Links Drupal's browser test output into .logs/browser_output, next to the other test artifacts.
  7. Adds the reverse-proxy and trusted-host settings that a public tunnel needs, when the tunnel is on.
  8. Runs your scripts/provision-*.sh lifecycle scripts.
  9. Prints the site URL and a one-time login link.

The database​

The site keeps its data in an SQLite file at /tmp/site_<extension>.sqlite, where <extension> is your extension's machine name. Each provision starts the database from scratch. To look inside the file, open it with DB Browser for SQLite.

Run Drush​

drush runs a Drush command against the site, with the site URL already set:

make drush status
make drush cr
make drush -- config:get system.site --format=json

Ahoy passes the arguments through as they are. make reads its command line first, so follow these rules with make drush:

  • Put -- before the arguments when they include an option, since make reads an option as its own.
  • An argument can't hold a space or name a make target, such as help, unless it's an option value joined with =.
  • An option joined with = reaches Drush after the other arguments, whatever its position.
  • A NAME=value word that isn't named like an option, such as DEBUG=1, stays a make variable and doesn't reach Drush.

Log in​

login prints a one-time login link for the admin account:

make login

A one-time link stops working after it's opened. Drush 12 and 13 open the link in your browser unless uli gets --no-browser. login passes that option on those versions, so the link it prints still works. Drush 14 never opens a browser and rejects the option. When you run drush uli yourself on Drush 12 or 13, add --no-browser too.

To have login also draw the link as a QR code, set LOGIN_QRCODE=1 in .env or your shell. The QR code helps you open the site on a phone over a public tunnel. The link that provision prints has no QR code. Any non-empty value turns the QR code on, 0 included. To turn it off, remove the variable from .env and your shell. The QR code needs qrencode on PATH, and without it login prints the link and then fails.