Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: lando quality improvements #34

Merged
merged 3 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it, much quicker at startup 😄

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';
}