We use Task in this project. Run
task site-updateto update the site (previously installed by running task site-install).
For performance reasons, we start only the basic docker services by default, but you can set
TASK_DOCKER_COMPOSE_PROFILES in .env.local to start more docker services based on
profiles, e.g.
# .env.local
# Always start pretix and friends.
TASK_DOCKER_COMPOSE_PROFILES=pretixYou can also set 'PROFILESwhen running thecompose` task, e.g.
PROFILES=pretix task compose -- up --detachYou may have to increase the Memory Limit in Docker Desktop to be able to start pretix and it's internal services (cf. celery/celery#2966 (comment)).
Tip
Run git grep -A2 'profiles:' '*.y*ml' to get a crude list of all profiles in the project.
When running task site-update, theme assets are built and this may take quite some time. To skip building assets, you
can run ASSETS_SKIP_BUILD=1 task site-update or set TASK_ASSETS_SKIP_BUILD in .env.local, e.g.
# .env.local
TASK_ASSETS_SKIP_BUILD=1Caution
The following should be updated and rewritten to reflect the actual development workflow.
Create the file web/sites/default/settings.local.php and add:
<?php
/**
* @file
* Local settings.
*/
/**
* Add development service settings.
*/
if (file_exists(__DIR__ . '/services.local.yml')) {
$settings['container_yamls'][] = __DIR__ . '/services.local.yml';
}
/**
* Disable CSS and JS aggregation.
*/
$config['system.performance']['css']['preprocess'] = FALSE;
$config['system.performance']['js']['preprocess'] = FALSE;
/**
* Disable caching.
*/
$settings['cache']['bins']['render'] = 'cache.backend.null';
$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
$settings['cache']['bins']['page'] = 'cache.backend.null';
/**
* Setup logging.
*/
$config['system.logging']['error_level'] = 'verbose';
/**
* Set Hash salt value.
*/
$settings['hash_salt'] = 'GIVE_ME_STRING';
/**
* Set trusted host pattern.
*/
$settings['trusted_host_patterns'] = [
'^hoeringsportal\.local\.itkdev\.dk$',
];
/**
* Set local db.
*/
$databases['default']['default'] = [
'database' => getenv('DATABASE_DATABASE') ?: 'db',
'username' => getenv('DATABASE_USERNAME') ?: 'db',
'password' => getenv('DATABASE_PASSWORD') ?: 'db',
'host' => getenv('DATABASE_HOST') ?: 'mariadb',
'port' => getenv('DATABASE_PORT') ?: '',
'driver' => getenv('DATABASE_DRIVER') ?: 'mysql',
'prefix' => '',
];Start docker
docker compose pull
docker compose up --detach
# Note: If you want to start pretix you have to enable the "pretix" profile (cf. https://docs.docker.com/compose/profiles/):
# docker compose --profile pretix up --detach
docker compose exec phpfpm composer install
docker compose exec phpfpm vendor/bin/drush --yes site:install --existing-config
# Build theme assets
docker compose run --rm node npm install --prefix web/themes/custom/hoeringsportal
docker compose run --rm node npm run build --prefix web/themes/custom/hoeringsportal
# Get admin sign in url
docker compose exec phpfpm vendor/bin/drush --yes --uri="http://deltag.local.itkdev.dk" user:loginAdd all fixtures
task fixtures:loadAll code must follow the Drupal coding standards.
Apply and check coding standard by running
task coding-standards:checktask code-analysisApply and check Markdown coding standards:
task coding-standards:markdown:checkSee Translations for details on how we handle translations.
Do we still use/need this
(cd web && ../vendor/bin/drush locale:export da --types=customized > ../translations/custom-translations.da.po)Open translations/custom-translations.da.po with the latest version of Poedit to clean up and
then save the file.
See How to deploy drupal interface translations for further details.
composer install --no-dev --optimize-autoloaderSee hoeringsportal_deskpro/README.md.
The WebProfiler can be installed to see useful information on what goes on behind the scenes:
task drush -- pm:install webprofiler