Skip to content

Commit

Permalink
Merge pull request #34 from localgovdrupal/feature/3.x/lando-improvem…
Browse files Browse the repository at this point in the history
…ents

refactor: lando quality improvements
  • Loading branch information
finnlewis authored Sep 26, 2023
2 parents 81567e3 + 4148ba4 commit 477aab8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
21 changes: 15 additions & 6 deletions .lando.dist.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: localgov-micro
recipe: drupal9
recipe: drupal10
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
2 changes: 1 addition & 1 deletion assets/composer/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,6 @@
if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) {
include $app_root . '/' . $site_path . '/settings.local.php';
}
elseif (file_exists($app_root . '/' . $site_path . '/settings.lando.php')) {
elseif (getenv('LANDO_SERVICE_NAME') == 'appserver' && file_exists($app_root . '/' . $site_path . '/settings.lando.php')) {
include $app_root . '/' . $site_path . '/settings.lando.php';
}

0 comments on commit 477aab8

Please sign in to comment.