Skip to content

Commit

Permalink
refactor: lando quality improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
millnut committed Sep 25, 2023
1 parent 81567e3 commit 498f9a2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
19 changes: 14 additions & 5 deletions .lando.dist.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: localgov-micro
recipe: drupal9
config:
xdebug: false
webroot: web
php: '8.1'
proxy:
Expand All @@ -27,6 +26,13 @@ proxy:
- group-b3.appserver
services:
appserver:
xdebug: true
scanner:
retry: 5
build_as_root:
# This disables Xdebug during build, but puts all dependencies in place
# ready for the tooling to enable Xdebug.
- rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && /etc/init.d/apache2 reload
overrides:
environment:
DRUSH_OPTIONS_ROOT: '/app/web'
Expand All @@ -35,6 +41,9 @@ services:
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", { "chromeOptions": { "w3c": false } }, "http://chromedriver:4444/wd/hub"]'
BROWSERTEST_OUTPUT_DIRECTORY: '/app/web/sites/simpletest/browser_output'
BROWSERTEST_OUTPUT_BASE_URL: 'https://localgov-micro.lndo.site'
# Support debugging CLI with Xdebug.
PHP_IDE_CONFIG: "serverName=appserver"
XDEBUG_SESSION: "lando"
build:
- mkdir -p web/sites/simpletest/browser_output
database:
Expand Down Expand Up @@ -86,11 +95,11 @@ tooling:
cmd: '/app/bin/phpunit --testdox'
xdebug-on:
service: appserver
description: Enable xdebug for apache.
cmd: "docker-php-ext-enable xdebug && /etc/init.d/apache2 reload"
description: Enable Xdebug for Apache.
cmd: rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && docker-php-ext-enable xdebug && /etc/init.d/apache2 reload && echo "Xdebug enabled"
user: root
xdebug-off:
service: appserver
description: Disable xdebug for apache.
cmd: "rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && /etc/init.d/apache2 reload"
description: Disable Xdebug for Apache.
cmd: rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && /etc/init.d/apache2 reload && echo "Xdebug disabled"
user: root
15 changes: 10 additions & 5 deletions assets/composer/settings.lando.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,20 @@
*/
$settings['skip_permissions_hardening'] = TRUE;

/**
* Get Lando info
*/
$lando_info = json_decode(getenv('LANDO_INFO'), TRUE);

/**
* Lando database credentials.
*/
$databases['default']['default'] = array (
'database' => 'database',
'username' => 'database',
'password' => 'database',
'host' => 'database',
'port' => '3306',
'database' => $lando_info['database']['creds']['database'],
'username' => $lando_info['database']['creds']['user'],
'password' => $lando_info['database']['creds']['password'],
'host' => $lando_info['database']['internal_connection']['host'],
'port' => $lando_info['database']['internal_connection']['port'],
'driver' => 'mysql',
'prefix' => '',
'collation' => 'utf8mb4_general_ci',
Expand Down

0 comments on commit 498f9a2

Please sign in to comment.