“how do I _____ on my local machine?”
Pre-requisites to installation:
- Ensure that
docroot/sites/default/settings/local.settings.php
exists by executingblt setup:drupal:settings
. - Verify that correct local database credentials are set in
local.settings.php
. - Ensure that project dependencies have already been built via
blt setup:build
To re-install Drupal, execute: blt setup:drupal:install
. Note that this will drop the existing database tables and install Drupal from scratch!
Please dependency management for all information on managing core and contributed packages for your project.
Please see Deploy for a detailed description of how to deploy to Acquia Cloud.
Please see testing.md for information on running tests.
To execute PHP codesniffer and PHP lint against the project codebase, run:
blt validate:all
Ideally, you will be using a theme that uses SASS/SCSS, a styleguide, and other tools that require compilation. Like dependencies, the compiled assets should not be directly committed to the project repository. Instead, they should be built during the creation of a production-ready build artifact.
BLT allows you to define a custom command that will be run to compile your project's frontend assets. You can specify the command in your project's project.yml
file under the target-hooks.frontend-build
key:
target-hooks:
frontend-build:
# The directory in which the command will be executed.
dir: ${docroot}
command: npm install.
If you need to run more than one command, you may use this feature to call a custom script:
target-hooks:
frontend-build:
# The directory in which the command will be executed.
dir: ${repo.root}
command: ./scripts/custom/my-script.sh
This command will be executed when dependencies are built in a local or CI environment, and when a deployment artifact is generated. You may execute the command directly by calling the frontend:build
target:
blt frontend:build
The project is configured to update the local environment with a local drush alias and a remote alias as defined in project.yml
or project.local.yml
. Given that these aliases match, those in drush/site-aliases/
, you can update the site with BLT. Please see drush/README.md for details on how to create these aliases.
This all in one command will make sure your local is in sync with the remote site.
blt local:refresh
blt local:sync
blt local:update
These tasks can be seen in build/core/phing/tasks/local-sync.xml
. An additional script can be added at /hooks/dev/post-db-copy/dev-mode.sh
which would run at the end of this task.