Drupal distribution and install profile to help UK councils collaborate and share Drupal code for publishing website content.
to install locally, you will need Composer and Lando.
https://getcomposer.org/ https://lando.dev/
Also see the Lando requirements section for details of Docker requirements.
https://docs.lando.dev/basics/installation.html#system-requirements
To install LocalGov Drupal locally for testing or development, use the Composer-based project template.
Change MY_PROJECT
to whatever you'd like your project directory to be called.
composer create-project --stability dev localgovdrupal/localgov-project MY_PROJECT
Change directory into the MY_PROJECT directory and run lando start.
cd MY_PROJECT
lando start
Once lando has finished building, run the site installer.
lando drush si localgov -y
If developing locally and you want to force composer to clone again
from source rather than use composer cache, you can add the --no-cache
flag.
composer create-project localgovdrupal/localgov-project MY_PROJECT --stability dev --no-cache
If you just want to pull in the latest changes to LocalGov Drupal run composer
update with the --no-cache
flag.
composer update --no-cache
If you want to be sure you are getting the latest commits when developing, clearing composer cache, deleting the folders and re-running composer update seems to be a solid approach:
rm -rf web/profiles/contrib/ web/modules/contrib/ web/themes/contrib/;
composer clear-cache; composer update --with-dependencies --no-cache;
lando start;
lando drush si localgov -y;
If you run into memory limit errors
when running Composer commands, prefix the commands with COMPOSER_MEMORY_LIMIT=-1
.
For example, to install the project run:
COMPOSER_MEMORY_LIMIT=-1 composer create-project --stability dev localgovdrupal/localgov-project MY_PROJECT
See CONTRIBUTING.md for current contribution guidelines.
In the early development stages, most issues will be tracked in this repository https://github.com/localgovdrupal/localgov/issues.
Development issues relating to specific projects or module should be tracked in the project repository. In the future we might set up a separate repository for centralised issue tracking of bug reports for end users.
The main development environment in use is currently Lando – a Docker based development environment that works on Linux, MacOS and Windows.
@todo Document Lando setup.
PHP CodeSniffer is installed as a dev dependency by Composer and configured to use Drupal coding standards and best practices. It is a good idea to run these before committing any code. All code in pull requests should pass all CodeSniffer tests.
To check code using Lando run:
lando phpcs
To attempt to automatically fix coding errors in Lando run:
lando phix
The included phpunit.xml.dist
file contains configuration for automatically
running the LocalGov Drupal test suite.
To run all LocalGov Drupal tests with Lando use:
lando phpunit
To run all the tests for a specific module use:
lando phpunit web/modules/contrib/localgov_my_module
Tests can be filtered using the --filter
option. To only run a specific test
use:
lando phpunit --filter=myTestName