|
name: drupal |
|
recipe: drupal11 |
|
config: |
|
webroot: web |
|
services: |
|
appserver: |
|
build: |
|
- mkdir -p $LANDO_WEBROOT/sites/simpletest/browser_output |
|
overrides: |
|
environment: |
|
# Support debugging Drush with Xdebug. |
|
#PHP_IDE_CONFIG: "serverName=appserver" |
|
|
|
# Allow XDebug with WSL2 on Windows. |
|
#LANDO_HOST_IP: "host.docker.internal" |
|
#XDEBUG_CONFIG: "remote_enable=1 remote_host=host.docker.internal" |
|
|
|
# PhpUnit vars. |
|
SIMPLETEST_BASE_URL: 'http://drupal.lndo.site' |
|
SIMPLETEST_DB: 'mysql://drupal11:drupal11@database/drupal11' |
|
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", { "chromeOptions": { "args": [ "disable-gpu", "headless", "no-sandbox" ] } }, "http://chromedriver:9515"]' |
|
BROWSERTEST_OUTPUT_DIRECTORY: /app/sites/simpletest/browser_output |
|
chromedriver: |
|
type: compose |
|
services: |
|
image: drupalci/webdriver-chromedriver:production |
|
# This is the ENTRYPOINT + CMD from the Dockerfile. Empty whitelisted-ips |
|
# param opens the chromedriver port for other hosts. |
|
command: chromedriver --log-path=/tmp/chromedriver.log --verbose --whitelisted-ips= |
|
tooling: |
|
drupal-download: |
|
service: appserver |
|
description: Download Drupal with Composer. |
|
cmd: |
|
- composer create-project drupal/recommended-project:11.0.0 tmp && cp -r tmp/. . && rm -rf tmp |
|
- composer require drush/drush |
|
drupal-local-settings: |
|
service: appserver |
|
description: Setup Drupal with local config. |
|
cmd: |
|
# 'cd' is throwing errors so for now we will copy each file to the full directory path. |
|
- FILE=$LANDO_WEBROOT/sites/default/services.local.yml && [ ! -f $FILE ] && wget -O $FILE https://raw.githubusercontent.com/segovia94/drupal-local-settings/master/services.local.yml || echo '$FILE already exist' |
|
- FILE=$LANDO_WEBROOT/sites/default/settings.local.php && [ ! -f $FILE ] && wget -O $FILE https://raw.githubusercontent.com/segovia94/drupal-local-settings/master/settings.local.php || echo '$FILE already exist' |
|
- FILE=$LANDO_WEBROOT/sites/default/settings.php && [ ! -f $FILE ] && wget -O $FILE https://raw.githubusercontent.com/segovia94/drupal-local-settings/master/settings.php || echo "\\\nif \(file_exists\(\$app_root . \'/\' . \$site_path . \'/settings.local.php\'\)\) { \\\n include \$app_root . \'/\' . \$site_path . \'/settings.local.php\'\;\\\n}" >> $FILE |
|
- "echo 'Your local Drupal config is setup'" |
|
drupal-install: |
|
service: appserver |
|
description: Install Drupal |
|
cmd: |
|
- APP=$LANDO_APP_NAME && drush si standard --account-pass=admin --account-name=admin --site-name=$APP |
|
- drush uli --uri=http://drupal.lndo.site |
|
xdebug-on: |
|
service: appserver |
|
description: Enable xdebug for apache. |
|
cmd: "docker-php-ext-enable xdebug && /etc/init.d/apache2 reload" |
|
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" |
|
user: root |
|
phpunit: |
|
service: appserver |
|
description: Run PHPUnit tests including browser and javascript tests |
|
cmd: "/app/vendor/bin/phpunit -c /app/core/phpunit.xml.dist" |
|
# Ensure that drush uses the domain name and drupal root directory. |
|
drush: |
|
service: appserver |
|
cmd: drush --root=/app --uri=http://drupal.lndo.site |
Note: the chromedriver
command
may need to be updated to includeallowed-origins
: