Skip to content

Commit

Permalink
Add local setup optimized for development
Browse files Browse the repository at this point in the history
- Introduce a new Lagoon environment type, local.
- Create new settings and services files with names to match this type
- Scaffold these files from assets to web on install
- Ensure scaffold is called during dev:reset. Composer install does not
always seem to have the intended effect
- Ignore the scaffolded files
  • Loading branch information
kasperg committed Nov 23, 2023
1 parent 9c88a3b commit c1659c0
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ tasks:
# packages may change without composer package version changes so ensure
# we have the latest version.
- task dev:cli -- composer reinstall danskernesdigitalebibliotek/dpl-design-system danskernesdigitalebibliotek/dpl-react --no-cache
# (Re)run Drupal scaffolding.
- task dev:cli -- composer drupal:scaffold
# Build dev scripts
- task dev:cli -- $(cd dev-scripts/dpl-react; composer install)
# Start local environment.
Expand Down
6 changes: 6 additions & 0 deletions assets/local.services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
twig.config:
debug: true
services:
cache.backend.null:
class: Drupal\Core\Cache\NullBackendFactory
11 changes: 11 additions & 0 deletions assets/local.settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

# Enable verbose error reporting.
$config['system.logging']['error_level'] = 'verbose';

# Disable preprocessing
$config['system.performance']['css']['preprocess'] = FALSE;
$config['system.performance']['js']['preprocess'] = FALSE;

# Disable caching.
$settings['cache']['default'] = 'cache.backend.null';
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@
"file-mapping": {
"[web-root]/sites/default/all.settings.php": "assets/all.settings.php",
"[web-root]/sites/default/development.settings.php": "assets/development.settings.php",
"[web-root]/sites/default/local.services.yml": "assets/local.services.yml",
"[web-root]/sites/default/local.settings.php": "assets/local.settings.php",
"[web-root]/.eslintrc.json": false,
"[project-root]/.gitattributes": {
"append": "assets/.gitattributes"
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ x-environment:
# Environment variables which mimic what will be set in a Lagoon cluster locally
LAGOON_PROJECT: 'dplcms'
LAGOON_ENVIRONMENT: 'local'
LAGOON_ENVIRONMENT_TYPE: 'local'
WEBROOT: web
# Uncomment if you like to have the system behave like in production
#LAGOON_ENVIRONMENT_TYPE: production
Expand Down
2 changes: 2 additions & 0 deletions web/sites/default/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
/development.settings.php
/default.development.services.yml
/default.services.yml
/local.settings.php
/local.services.yml
/settings.lagoon.php

0 comments on commit c1659c0

Please sign in to comment.