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 #129

Merged
merged 1 commit into from
Oct 2, 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
refactor: lando quality improvements
  • Loading branch information
millnut committed Sep 23, 2023
commit 002b076b6261d544f67f3d054fdb03ef9db9944e
19 changes: 13 additions & 6 deletions .lando.dist.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: localgov
recipe: drupal10
config:
xdebug: false
webroot: web
php: '8.1'
proxy:
Expand All @@ -13,6 +12,11 @@ proxy:
- 'solr-sitewide.localgov.lndo.site:8983'
services:
appserver:
xdebug: true
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 @@ -21,6 +25,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.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 All @@ -40,7 +47,7 @@ services:
command: '/bin/s6-svscan /etc/services.d'
portforward: true
node:
type: 'node:16'
type: 'node:18'
globals:
gulp-cli: latest
overrides:
Expand Down Expand Up @@ -84,13 +91,13 @@ 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
gulp:
service: node
Expand Down
11 changes: 10 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
{
"configurations": [
{
"name": "Listen for Xdebug",
"name": "Listen for Xdebug (ddev)",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/var/www/html": "${workspaceRoot}"
}
},
{
"name": "Listen for Xdebug (lando)",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/app": "${workspaceRoot}"
}
}
]
}
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