Build the site
build assembles a Drupal codebase in the build directory and starts the PHP webserver. It then installs the Drupal website with your extension enabled, the same way CI builds it. assemble links your extension's files into the site, so an edit in your project shows up in the site straight away. This page covers what each step does and how to see the full output when a step fails.
To build the site, run the following command from the root of your project:
- Make
- Ahoy
- No wrapper
make build
ahoy build
scripts/eddy-tooling # Install the tooling
vendor/bin/eddy-assemble # Assemble the codebase
vendor/bin/eddy-start # Start the PHP server
vendor/bin/eddy-provision # Provision the Drupal website
Without a wrapper, run scripts/eddy-tooling first: it installs the vendor/bin/eddy-* commands that run after it. make and Ahoy run it for you (see Tooling package).
Confirm that the build worked: it ends with PROVISION COMPLETE, the site URL and a one-time login link.
What build runs
build runs assemble, start and provision in turn. Each command ends by running your lifecycle scripts for its phase:
To run only part of the job, run the commands on their own:
- Make
- Ahoy
- No wrapper
make assemble # Assemble the codebase
make start # Start the PHP server
make provision # Provision the Drupal website
ahoy assemble # Assemble the codebase
ahoy start # Start the PHP server
ahoy provision # Provision the Drupal website
vendor/bin/eddy-assemble # Assemble the codebase
vendor/bin/eddy-start # Start the PHP server
vendor/bin/eddy-provision # Provision the Drupal website
To reinstall the website on the codebase you already have, run provision on its own. After you change composer.json, composer.dev.json or a patch, run build again.
What assemble does
assemble builds a fresh codebase every time, in this order:
- Checks your project: its
composer.jsonand.info.yml, thecomposercommand andcomposer validate --strict. - Passes
GITHUB_TOKENto Composer asCOMPOSER_AUTH, unlessCOMPOSER_AUTHis set (see SetGITHUB_TOKEN). - Resolves the Drupal release to build from
DRUPAL_VERSION(see Drupal versions). - Checks that the PHP running the build meets that release's PHP requirement, and that any
config.platform.phpyou set meets it too. When either falls short,assemblestops before it touchesbuild. - Stops the webserver when it still serves an earlier build of this project. Like the
stopcommand, it first runs yourscripts/stop-*.shlifecycle scripts. This step comes after the checks, so a failed check leaves your site running. - Removes the old
builddirectory and creates a Drupal project from drupal/recommended-project, with core pinned to the resolved release. - Sets the stability that resolves the other dependencies (see How versions are resolved), and the versions of the test tools that fit the Drupal major. A Drupal 12 build also gets PHPUnit 12 and installs
drupal/corefrom source. - Merges the development dependencies and settings of
composer.dev.jsoninto the project, then those of your extension'scomposer.json. Then it pins the PHP platform. - Copies your
patchesdirectory intobuildand installs the dependencies, which applies your patches. Then it adds the extensions yousuggest. - Lists every dependency it installed from a development branch, so you can see when a build relies on unreleased code.
- Turns off deprecation notices when
SYMFONY_DEPRECATIONS_HELPERisdisabled(see Deprecated code). It writes the setting into the site'sindex.phpanddefault.settings.php, and into the core copy ofdefault.settings.phpthat Functional test sites start from. - Copies the configuration files of the tools into
build, because some tools misread a symlinked configuration file. Edit these files in your project, and runassembleagain to apply a change. It copies each of the following files that your project has:phpcs.xml,phpstan.neon,rector.phpand.twig-cs-fixer.php, for the PHP linters.eslintrc.json,.eslintignore,.prettierrc.json,.prettierignoreand.stylelintrc.js, for the JavaScript and CSS lintersphpunit.xml, orphpunit.d10.xmlin its place in a Drupal 10 buildjest.config.js,package.jsonandpackage-lock.json, for Jest and npm
- Creates your extension's directory in the site:
build/web/modules/custom/<your_extension>for a module orbuild/web/themes/custom/<your_extension>for a theme. The directory holds a symlink to every top-level file and directory of your project, apart frombuild,vendorand the names that start with a dot. - Runs
npm ciandnpm run buildinbuildwhen your project has apackage-lock.jsonand no.skip_npm_buildfile (see Frontend dependencies). - Runs your
scripts/assemble-*.shlifecycle scripts.
Other commands along the way
These commands help you look at the build and clear it away:
info(aliasdescribe) prints a read-only summary of the environment. It shows the versions of Drupal, PHP and the tools, plus the webserver host and port with the source of each. It also shows the site URL, the XDebug state, the build directory, the database path and the install profile. With FunctionalJavascript tests, it adds the WebDriver port.reset(aliasesdeleteanddestroy) stops the project's webserver and browser. Then it removes thebuild,.logsandvendordirectories from the project root. Removingvendoris also how a local checkout picks up a newer patch release of the tooling.resetkeeps the database file, and the nextprovisionreinstalls the site in it.make helplists themakecommands, since a baremakerunsbuild. A bareahoylists the Ahoy ones.
To summarize the environment or start over, run the following commands:
- Make
- Ahoy
- No wrapper
make info # Summarize the environment
make reset # Remove build, .logs and vendor
ahoy info # Summarize the environment
ahoy reset # Remove build, .logs and vendor
vendor/bin/eddy-info # Summarize the environment
Without a wrapper, run vendor/bin/eddy-stop and vendor/bin/eddy-browser-stop, then remove build, .logs and vendor, to do what reset does.
vendor/bin/eddy-info also prints a single field when you name it, such as vendor/bin/eddy-info site-url. The wrappers find the site URL that way. For the full list, see eddy-info fields.
See the full output
The build hides the output of Composer, npm ci and Drush until a command fails. To stream that output as it happens, set DEBUG=1:
- Make
- Ahoy
- No wrapper
DEBUG=1 make build
DEBUG=1 ahoy build
export DEBUG=1
vendor/bin/eddy-assemble
vendor/bin/eddy-start
vendor/bin/eddy-provision
Command output covers which output DEBUG streams, and Logs covers the processes that keep running after a command returns.
Your extension's contributors
The installer generates a CONTRIBUTING.md that documents these commands for the people who work on your extension. It names only the command wrappers and tools you kept.