Drupal poject setup steps, for use in Lando environment.
lando init
- Copy, adjust pertinent sections from provided
.lando.yml
lando start
lando composer create-project drupal/recommended-project my_site
cp -r my_site/. .
rm -rf my_site
Update the project name, etc. in composer.json
.
Add a few things we know we'll want.
lando composer config --no-plugins allow-plugins.cweagans/composer-patches true
lando composer config --no-plugins allow-plugins.wikimedia/composer-merge-plugin true
lando composer require -n cweagans/composer-patches \
drupal/admin_toolbar \
drupal/config_split \
drupal/devel \
drupal/devel_php \
drupal/environment_indicator \
drupal/module_filter \
drush/drush \
wikimedia/composer-merge-plugin
Configure Composer merge plugin in composer.json
.
{
"extra": {
"merge-plugin": {
"include": [
"web/modules/custom/*/composer.json",
"web/modules/custom/*/modules/*/composer.json",
"web/themes/custom/*/composer.json"
]
}
}
}
Add the .gitignore
file to the root of the project.
lando composer require kerasai/lamp-env:^1@alpha
- Add PSR-4 loading to
composer.json
- Add env detection class to project
- Setup Drupal settings files
settings.php
- From
kerasai/lamp-env
- From
settings.default.php
- Set random "salt", can obtain via https://www.uuidgenerator.net/
settings.dev.php
- And
develop.services.yml
- And
settings.lando.php
Add to the settings files as needed when you build-out the site.
Locally you can override as needed using settings.local.php
. It's a good idea to throw in an settings.local.php
file as well, with example code that can be copy/paste-d to the local settings file.
Install the site, enable some dev utilities, remove some extra "cruft" we can do without.
lando drush si -y standard
lando drush en -y admin_toolbar admin_toolbar_tools config_split devel devel_php environment_indicator module_filter
lando drush edel shortcut
lando drush pm:uninstall announcements_feed contact search shortcut tour
Set up the dev split:
mkdir -p web/config/split/dev
- Set up the split in the UI
- Machine name:
dev
- Folder
../config/split/dev
- Active: No (will be overridden by settings files)
- Complete split of
devel
anddevel_php
Export config with lando drush cex -y
. You should see the config/sync
directory filled with the site's config (minus the dev modules), and config/split/dev
will contain the dev modules' config.
Edit config/sync/core.extension.yml
, replace standard
with minimal
. This is necessary because the standard
install profile does some setup in its hook_install
and it cannot install from config.
From here you will be able to install/reinstall the site as needed using lando drush si -y --existing-config
.