Skip to main content

Environment variables

This page lists every environment variable that the Eddy commands, the tests and the CI workflows read, with its default and what it does. The variables under Build, Webserver and site and Tests configure your machine. The ones under Deployment and Continuous integration configure the workflows of your GitHub repository.

Where values come from​

The tooling commands read a variable from your shell first and from the project's .env file second. An empty value in your shell counts as unset. Git ignores .env, so it's the place for values that belong to your machine, such as the ports that start and browser-start save there.

make and Ahoy load .env into the environment of every command, and keep a variable that your shell sets to a non-empty value. So a prefix such as WEBSERVER_PORT=9000 changes a value for 1 command and leaves .env as it is. A variable you export from your shell profile overrides the .env of every project.

A few variables and readers follow other rules:

  • TUNNEL_URL comes from .env only.
  • make and Ahoy always set SIMPLETEST_BASE_URL, SIMPLETEST_DB and BROWSERTEST_OUTPUT_DIRECTORY themselves, over both your shell and .env.
  • The tests, scripts/eddy-tooling, eddy-deploy and the SYMFONY_DEPRECATIONS_HELPER check of assemble read the process environment only, so a value in .env reaches them only through make or Ahoy.

Build​

The following variables configure the build:

VariableDefaultWhat it does
DRUPAL_VERSIONextra.eddy.drupal-version in composer.dev.json, or 11The Drupal version to build, such as 11, 11.1.0 or 11@beta. See Drupal versions.
DRUPAL_PROFILEstandardThe install profile that provision installs the site from.
GITHUB_TOKENUnsetA GitHub token that the build passes to Composer to get around API rate limits.
COMPOSER_AUTHBuilt from GITHUB_TOKENComposer credentials. A value you set is used as it is.
NVM_DIR$XDG_CONFIG_HOME/nvm, or ~/.nvmThe nvm directory. With an .nvmrc, the build loads nvm from it. See Frontend dependencies.
DEBUGUnset1 streams the full output of Composer and npm, and the progress of Drush. Other values change nothing. See Debug your extension.
TMPDIRYour system's temporary directoryThe temporary directory of the commands. make and Ahoy turn a relative path into an absolute one, so the tools that run in build find it.

Webserver and site​

The following variables configure the webserver and the site URL:

VariableDefaultWhat it does
WEBSERVER_HOSTlocalhostThe host the webserver listens on and the site URL names.
WEBSERVER_PORTThe first free port from 8000, saved to .envThe port of the webserver. See How the port is picked.
WEBSERVER_WAIT_TIMEOUT5Seconds that start waits for the webserver to accept connections. A whole number of 1 or more.
XDEBUGUnsetAny non-empty value starts the webserver with XDebug step-debugging, 0 included. debug sets it for the server it starts, without saving it to .env. See Step-debug with XDebug.
CLOUDFLARE_TUNNELUnset1, or any value other than 0, false, no and off in any letter case, exposes the site through a public Cloudflare quick tunnel. An empty value in your shell counts as unset, so it doesn't override a .env that turns the tunnel on. See Public tunnel.
TUNNEL_URLWritten to .env by startThe public URL of a tunnel, which the commands use as the site URL.
LOGIN_QRCODEUnsetAny non-empty value makes login also draw the login link as a QR code.

Tests​

The following variables configure the tests. make, Ahoy and phpunit.xml set most of them for you:

VariableDefaultWhat it does
WEBDRIVER_BACKENDchromedriverThe browser for FunctionalJavascript tests: chromedriver drives your local Chrome, selenium a Docker container.
WEBDRIVER_PORTThe first free port from 4444, saved to .envThe port of the WebDriver endpoint.
WEBDRIVER_HOSTlocalhost. With selenium, host.docker.internal on macOS and 172.17.0.1 on other systemsThe address the browser uses to reach the webserver.
SIMPLETEST_BASE_URLSet by make and Ahoy, otherwise http://localhost:8000 from phpunit.xmlThe site URL that Functional tests request. The FunctionalJavascript base class swaps its host for WEBDRIVER_HOST.
SIMPLETEST_DBSet by make and Ahoy, otherwise a database from phpunit.xmlThe SQLite database that Kernel and Functional tests install into.
BROWSERTEST_OUTPUT_DIRECTORYSet by make and Ahoy to .logs/browser_output, otherwise unsetTurns on the saving of the HTML pages that tests visit, and must name an existing, writable directory. Drupal saves the pages themselves to sites/simpletest/browser_output, which provision links into .logs/browser_output. Without a wrapper, export it before you run the tests. See Test output.
BROWSERTEST_OUTPUT_BASE_URLEmpty in phpunit.xmlThe base URL of the links to saved pages, for when SIMPLETEST_BASE_URL isn't reachable from your browser.
BROWSERTEST_OUTPUT_VERBOSEUnsetfalse stops a run from listing the saved pages at its end.
MINK_DRIVER_CLASSEmpty in phpunit.xmlThe Mink driver class of browser tests.
MINK_DRIVER_ARGSEmpty in phpunit.xmlThe arguments of that driver.
MINK_DRIVER_ARGS_WEBDRIVERSet in phpunit.xmlThe browser and WebDriver endpoint of FunctionalJavascript tests. An exported value wins over the file, and the base class points the endpoint at WEBDRIVER_PORT.
SYMFONY_DEPRECATIONS_HELPERUnsetHow tests treat deprecations. phpunit.xml holds examples to uncomment. With disabled, assemble also turns off deprecation notices in the site. See Deprecated code.

Deployment​

These variables configure the deployment that the Deploy workflow runs with eddy-deploy. Set up deployment covers setting them. The Set as column of the deployment and CI tables names where each value is set:

  • Secret - a repository secret, under Settings > Secrets and variables > Actions > Secrets.
  • Variable - a repository variable, on the Variables tab of the same page.
  • Workflow - the workflow itself.
  • Your workflow - a workflow of your own, since the Deploy workflow doesn't pass it.

The following table lists the deployment variables:

VariableSet asWhat it does
DEPLOY_REMOTESecretThe git remote to deploy to, such as git@git.drupal.org:project/myextension.git. Deployment is skipped until it's set.
DEPLOY_SSH_KEYSecretThe private SSH key that pushes to the remote. Required when DEPLOY_REMOTE is set.
DEPLOY_USER_NAMESecretThe name that git uses on the runner. Required when DEPLOY_REMOTE is set, or the deployment fails. The deployed commits keep their own authors.
DEPLOY_USER_EMAILSecretThe email address that git uses on the runner. Required when DEPLOY_REMOTE is set, like DEPLOY_USER_NAME.
DEPLOY_PROCEEDSecret1 lets the deployment push. Any other value runs the job without pushing.
DEPLOY_BRANCHVariableThe branch to push to in the remote repository. Defaults to the branch that triggered the build.
DEPLOY_TAGWorkflowThe tag to deploy. The Deploy workflow sets it for a tag push, and eddy-deploy then pushes only that tag and ignores DEPLOY_BRANCH. Without it, eddy-deploy pushes the branch and no tags.
DEPLOY_SSH_KEY_FINGERPRINTYour workflowLoads ~/.ssh/id_rsa_<fingerprint> into the SSH agent before the push, starting an agent when SSH_AGENT_PID is empty. For a CI that installs keys by fingerprint. The Deploy workflow doesn't pass it, so set it in a workflow of your own.

Continuous integration​

The following variables configure the Test workflow. Here, Workflow means that .github/workflows/test.yml sets the value:

VariableSet asWhat it does
CODECOV_TOKENSecretUploads code coverage to Codecov when it's set.
CI_<TOOL>_IGNORE_FAILUREVariable1 lets that lint or test step fail without failing its job. See Allow a CI step to fail.
CI_RUNNER_INDEXWorkflowThe position of the job among the legs of its matrix, counting from 0. The workflow takes it from strategy.job-index. See Distribute tools across CI runners.
CI_RUNNER_TOTALWorkflowThe number of legs in the matrix. The workflow takes it from strategy.job-total.
CI_IS_<TOOL>_RUNNERWorkflowtrue runs that tool's steps on the job. Each test job sets the flags of the tools it runs.