diff --git a/.circleci/config.yml b/.circleci/config.yml index 5675e10..031f404 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,10 +13,10 @@ # # * TERMINUS_MACHINE_TOKEN # -# It also depends on the following environment variables declared in docker/drupal.env: +# It also depends on the following environment variables declared in .env/drupal.env: # # * TERMINUS_SITE -# * TERMINUS_SOURCE_ENVIRONMENT +# * TERMINUS_ENV # version: 2.1 @@ -81,10 +81,10 @@ jobs: - run: name: Prepare Environment command: | - echo "source /var/www/code/docker/drupal.env" >> $BASH_ENV && source /var/www/code/docker/drupal.env + echo "source /var/www/code/.env/drupal.env" >> $BASH_ENV && source /var/www/code/.env/drupal.env mkdir /tmp/junit /tmp/artifacts web/sites/simpletest web/sites/default/files && chown www-data:www-data /tmp/junit web/sites/default/files web/sites/simpletest terminus auth:login --machine-token="$TERMINUS_MACHINE_TOKEN" - terminus backup:info "$TERMINUS_SITE.$TERMINUS_SOURCE_ENVIRONMENT" --element=db --field=file > /tmp/db-cache-indicator + terminus backup:info "$TERMINUS_SITE.$TERMINUS_ENV" --element=db --field=file > /tmp/db-cache-indicator # Run linting steps up front. If these fail, they should provide fast feedback. - run: {name: 'ESLint', command: 'node_modules/.bin/eslint -f junit . > /tmp/junit/eslint.xml'} - run: {name: 'PHPCS', command: 'vendor/bin/phpcs --report-junit=/tmp/junit/phpcs.xml --report-summary'} @@ -98,7 +98,7 @@ jobs: - run: {name: 'Nightcrawler', command: 'node_modules/.bin/nightcrawler crawl --json /tmp/artifacts/results.json --junit /tmp/junit/crawler.xml'} # Run PHPUnit as www-data to support BrowserTestBase installing the site. - run: {name: 'Run PHPUnit', command: 'su -s /bin/bash www-data -c "vendor/bin/phpunit --log-junit=/tmp/junit/phpunit.xml"'} - - run: {name: 'Run Behat', command: 'vendor/bin/behat -f junit -o /tmp/junit'} + - run: {name: 'Run Behat', command: 'vendor/bin/behat --profile=ci -f junit -o /tmp/junit'} - store_test_results: { path: '/tmp/junit' } - store_artifacts: {path: '/tmp/artifacts'} @@ -106,14 +106,14 @@ jobs: executor: php steps: - attach_workspace: {at: /var/www} - - run: {name: 'Source environment variables', command: 'echo "source /var/www/code/docker/drupal.env" >> $BASH_ENV'} + - run: {name: 'Source environment variables', command: 'echo "source /var/www/code/.env/drupal.env" >> $BASH_ENV'} - run: {name: 'Terminus Login', command: 'terminus auth:login --machine-token="$TERMINUS_MACHINE_TOKEN"'} - run: {name: 'Export git variables', command: 'terminus connection:info --fields=git_host,git_port,git_url --format=json "$TERMINUS_SITE.dev" | bin/json-to-bash >> $BASH_ENV'} - run: {name: 'Trust host key', command: 'ssh-keyscan -p $GIT_PORT $GIT_HOST >> /etc/ssh/ssh_known_hosts'} - run: {name: 'Set git committer', command: 'git config --global user.email "$GIT_AUTHOR_EMAIL" && git config --global user.name "$GIT_AUTHOR_NAME"'} - run: {name: 'Lean Composer install', command: 'composer install --no-dev -o -n'} - run: {name: 'Push Artifact', command: 'node_modules/.bin/artifactsh -a $GIT_URL -b $CIRCLE_BRANCH'} - - run: {name: 'Ensure multidev', command: 'test $CIRCLE_BRANCH == "master" || bin/create-artifact-environment-pantheon -b $CIRCLE_BRANCH -s $TERMINUS_SOURCE_ENVIRONMENT'} + - run: {name: 'Ensure multidev', command: 'test $CIRCLE_BRANCH == "master" || bin/create-artifact-environment-pantheon -b $CIRCLE_BRANCH -s $TERMINUS_ENV'} - run: {name: 'Prune multidev environments', command: 'bin/prune-artifact-environments-pantheon -p "p-*"'} - run: {name: 'Prune branches', command: 'bin/prune-artifact-branches -a $GIT_URL -p "p-*"'} workflows: diff --git a/.env/default.private.env b/.env/default.private.env new file mode 100644 index 0000000..3e45403 --- /dev/null +++ b/.env/default.private.env @@ -0,0 +1,17 @@ +# This file contains environment variables for sensitive information that +# should not be committed to the repository. + +# This default file is included in the repository as a guideline for things +# that may be useful to pass into the application services. + +# Machine token from Pantheon that allows terminus commands to be executed +# from within the appserver service. +TERMINUS_MACHINE_TOKEN=abcdefghijklmnopqrstuvwxyz1234567890 + +# Blackfire client and server ids. Required for Blackfire profiling. Obtain +# these by creating an account at blackfire.io and visiting +# https://blackfire.io/my/settings/credentials +BLACKFIRE_CLIENT_ID=abcdefghijklmnopqrstuvwxyz1234567890 +BLACKFIRE_CLIENT_TOKEN=abcdefghijklmnopqrstuvwxyz1234567890 +BLACKFIRE_SERVER_ID=abcdefghijklmnopqrstuvwxyz1234567890 +BLACKFIRE_SERVER_TOKEN=abcdefghijklmnopqrstuvwxyz1234567890 diff --git a/docker/drupal.env b/.env/drupal.env similarity index 94% rename from docker/drupal.env rename to .env/drupal.env index 89b49db..ec6fb14 100644 --- a/docker/drupal.env +++ b/.env/drupal.env @@ -13,4 +13,4 @@ TERMINUS_SITE=scaffold # Machine name of Pantheon environment to pull db from. This is # also the environment new multidev instances start from. -TERMINUS_SOURCE_ENVIRONMENT=dev +TERMINUS_ENV=dev diff --git a/.gitignore b/.gitignore index f737594..180e07c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ web/sites/*/files web/sites/*/settings.local.php web/sites/simpletest/* -.env +.env/private.env docker-compose.override.yml # Contrib/external code: diff --git a/.lando.yml b/.lando.yml new file mode 100644 index 0000000..60493e5 --- /dev/null +++ b/.lando.yml @@ -0,0 +1,79 @@ +name: drupal-scaffold +recipe: drupal8 +config: + webroot: web #@docroot + php: 7.2 + via: nginx + drush: ^8 + xdebug: false +env_file: + - .env/drupal.env + - .env/private.env +proxy: + mannequin: + - mannequin.lndo.site +services: + appserver: + build: + - composer install + build_as_root: + - .lando/init/terminus.sh + - .lando/init/blackfire.sh + overrides: + environment: + BLACKFIRE_CLIENT_ID: + BLACKFIRE_CLIENT_TOKEN: + + node: + type: node + build: + - yarn install + globals: + gulp-cli: latest + mannequin: + type: compose + services: + image: devwithlando/php:7.3-apache + command: docker-php-entrypoint /app/vendor/bin/mannequin start -c /app/.mannequin.php *:80 + blackfire: + type: compose + keys: false + app_mount: false + services: + image: "blackfire/blackfire" + user: root + command: blackfire-agent + environment: + BLACKFIRE_SERVER_ID: # Set in .env if you want to use Blackfire. + BLACKFIRE_SERVER_TOKEN: # Set in .env if you want to use Blackfire. + LANDO_DROP_USER: blackfire + +tooling: + gulp: + service: node + yarn: + service: node + npm: + service: node + cmd: "echo 'NPM is disabled in favor of yarn'" + behat: + service: appserver + cmd: vendor/bin/behat + phpunit: + service: appserver + cmd: vendor/bin/phpunit + phpcs: + service: appserver + cmd: vendor/bin/phpcs + eslint: + service: node + cmd: node_modules/.bin/eslint + terminus: + service: appserver + latest_db_pantheon: + service: appserver + description: Updates the database from the latest Pantheon backup + cmd: bin/refresh-local-pantheon + blackfire: + service: appserver + user: root diff --git a/.lando/init/blackfire.sh b/.lando/init/blackfire.sh new file mode 100755 index 0000000..873b2b8 --- /dev/null +++ b/.lando/init/blackfire.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -e + +echo "Installing Blackfire PHP Probe..." +curl -o $(php -r "echo ini_get('extension_dir');")/blackfire.so -L -s https://packages.blackfire.io/binaries/blackfire-php/1.34.0/blackfire-php-linux_amd64-php-$(php -r "echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;").so +printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini + +echo "Installing Blackfire CLI..." +curl -o /usr/local/bin/blackfire -L -s https://packages.blackfire.io/binaries/blackfire-agent/1.35.1/blackfire-cli-linux_static_amd64 +chmod +x /usr/local/bin/blackfire diff --git a/.lando/init/terminus.sh b/.lando/init/terminus.sh new file mode 100755 index 0000000..cf06e47 --- /dev/null +++ b/.lando/init/terminus.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +wget https://github.com/pantheon-systems/terminus/releases/download/2.3.0/terminus.phar -O /usr/local/bin/terminus +chmod +x /usr/local/bin/terminus +[ -z "$TERMINUS_MACHINE_TOKEN" ] && echo "Terminus machine token not set" || terminus auth:login --machine-token=$TERMINUS_MACHINE_TOKEN diff --git a/.mannequin.php b/.mannequin.php index 685f0ae..5c09e3b 100644 --- a/.mannequin.php +++ b/.mannequin.php @@ -14,13 +14,14 @@ 'drupal_root' => __DIR__.'/web', 'twig_options' => [ 'auto_reload' => TRUE, - ] + ], ]); $config = MannequinConfig::create() ->addExtension($drupalExtension) ->setGlobalCss([ 'web/themes/custom/scaffold/dist/css/style.css', + 'web/core/themes/stable/css/system/components/hidden.module.css', ]) ->setGlobalJs([ 'web/core/assets/vendor/jquery/jquery.min.js', diff --git a/CHANGELOG.md b/CHANGELOG.md index abd5bcc..3125e1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ * Enabled Drupal js behaviors in Mannequin by default. * Remove dockerized settings in default.settings.php - this file will be used whenever KernelTestBase is executed, causing the site under test to pick up the Dockerized/local settings as it's own. * Use `CACHE_HOST`, `CACHE_PORT`, `CACHE_PASSWORD` in `settings.docker.php` instead of REDIS_* equivalents. This brings us into line with Pantheon's environment variables. -* Replace environment variables in the default CircleCI build: `PSITE` -> `TERMINUS_SITE`, `PSRCENV` -> `TERMINUS_SOURCE_ENVIRONMENT`, `PMACHINE` -> `TERMINUS_MACHINE_TOKEN`. These variables will remain consistent with what we use in Docker. +* Replace environment variables in the default CircleCI build: `PSITE` -> `TERMINUS_SITE`, `PSRCENV` -> `TERMINUS_ENV`, `PMACHINE` -> `TERMINUS_MACHINE_TOKEN`. These variables will remain consistent with what we use in Docker. * Use `yarn` in all documentation, CircleCI steps. Yarn is a drop-in replacement for `npm` that is much faster. * Configure ESLint through `.eslintignore` in repository root rather than custom Gulp configuration. * Configure PHPCS through `phpcs.xml.dist` in repository root rather than custom Gulp configuration. diff --git a/README.md b/README.md index d0d9da5..2ec56e3 100644 --- a/README.md +++ b/README.md @@ -11,17 +11,17 @@ Starting a New Project ```bash composer create-project lastcall/drupal-scaffold PROJECTNAME ``` -- [ ] Bring up the Docker containers and enter the Drupal container. +- [ ] Update the project's `name` in `.lando.yml` +- [ ] Bring up the local development environment. ```bash - docker-compose up -d drupal - docker-compose exec drupal /bin/bash + lando start ``` -- [ ] From the repository root (`/var/www` inside the Drupal container), install NPM and composer dependencies: +- [ ] Install project's php and frontend dependencies ```bash - yarn install - composer install + lando yarn install + lando composer install ``` -- [ ] Visit the Drupal site in your browser to install Drupal and continue. The default URL will be `http://localhost:8080`. +- [ ] Visit the Drupal site at one of the urls output by lando. See the [scaffold documentation](docs/scaffold.md) for next steps. @@ -33,31 +33,33 @@ Everything below this line applies to scaffold projects that are already set up. Setting Up for Local Development -------------------------------- - -This project is built using Drupal Scaffold. Before you begin, you must have Docker and Docker Compose installed on your local machine. For installation instructions, see the [Drupal Scaffold - Docker documentation](https://github.com/LastCallMedia/Drupal-Scaffold/blob/master/docs/tools/docker.md). +This project is built using Drupal Scaffold. Before you begin, you must have Lando installed on your local machine. For installation instructions, see the [Drupal Scaffold - Lando documentation](https://github.com/LastCallMedia/Drupal-Scaffold/blob/master/docs/tools/lando.md). 1. [Clone](https://help.github.com/articles/cloning-a-repository/) this repository. 2. If you haven't created and [set your Pantheon machine token](https://github.com/LastCallMedia/Drupal-Scaffold/blob/master/docs/recipes/setting-machine-token.md), do that now. 3. [Start](https://github.com/LastCallMedia/Drupal-Scaffold/blob/master/docs/tools/docker.md#Running) the Docker environment and shell in: ```bash - docker-compose up -d drupal - docker-compose exec drupal bash + lando start ``` 3. Install [Composer](https://github.com/LastCallMedia/Drupal-Scaffold/blob/master/docs/tools/composer.md#Running) dependencies: ```bash - composer install + lando composer install ``` 4. Install [NPM](https://github.com/LastCallMedia/Drupal-Scaffold/blob/master/docs/tools/npm.md#Running) dependencies: ```bash - yarn install + lando yarn install + ``` +5. Import a database + ```bash + # Download a copy of the database backups from the hosting environment and save it to the projectroot + lando db-import [file] + ``` +6. Compile and watch frontend assets + ```bash + lando gulp watch ``` -5. Run `composer site:import` to pull down and import a copy of the site's database. If Pantheon gives you an error here, make sure you followed Step 2 above correctly and that you're running Docker in a new terminal window - -6. Run `drupal site:mode dev` to switch to dev configuration. - -7. Run `gulp build` (or `gulp watch`) and `drush cr` (from within the Drupal root at `/var/www/web`) to compile the theme. -8. View your new local site in the browser at [http://localhost:8080/](http://localhost:8080/). +8. View your new local site in the browser at a url provided by lando when running `lando start` See the [Drupal Scaffold documentation](https://github.com/LastCallMedia/Drupal-Scaffold/blob/master/docs/) for more information on how to use the tools and how to use this project. To find more information on the Docker stack, visit the [Docker documenation](https://github.com/LastCallMedia/Drupal-Scaffold/blob/master/docs/tools/docker.md). diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..6f8e1ed --- /dev/null +++ b/TODO.md @@ -0,0 +1,25 @@ +TODO +==== + +- [ ] BLACKFIRE: Enable Blackfire in Lando (see [this issue](https://github.com/lando/lando/issues/511) and [this gist](https://gist.github.com/tylerssn/8923149702d4a796c5e103412c2370c3)) + - Update Blackfire docs in docs/tools/blackfire.md +- [x] WDIO: + - Disable, remove WDIO configuration + - Documentation at docs/tools/wdio.md +- [x] MANNEQUIN: + - Add mannequin service to Lando config + - Update Mannequin docs at docs/tools/mannequin.md +- [x] VARNISH: + - Determine if we still want a varnish service + - [ ] If yes: + - add varnish service to .lando.yml + - [x] If no: + - Remove docker/default.vcl, docs in docs/tools/varnish.md +- [ ] DOCKER-COMPOSE: Since we're switching from docker-compose to lando it would be confusing to leave the docker-compose functionality in here, documented or not. We should remove config and references to the old docker-compose local infrastructure + - [ ] Remove `docker-compose.yml` + - [x] Remove `docker` directory +- [x] LOCAL DEVELOPMENT TOOLS: + - Determine if we need the `site-import` tooling in `appserver` + - If yes: + - [x] Add terminus commands and scripts for importing a database + - ~~[ ] Add acquia API commands for importing databases~~ diff --git a/behat.yml b/behat.yml index 409163a..c52354e 100644 --- a/behat.yml +++ b/behat.yml @@ -30,9 +30,8 @@ default: extensions: Behat\MinkExtension: goutte: ~ - # The base URL of the site. If you are using the gulp tasks, - # this URL is set in the gulpconfig, so leave this commented out. - # base_url: http://127.0.0.1:8888 + # The base URL of the site. + base_url: "http://appserver_nginx" # internal nginx url. For testing with Lando, this should not have to be changed. # Browser open command used for "Then show the last response" show_cmd: open %s Drupal\DrupalExtension: @@ -50,3 +49,7 @@ default: error_message_selector: '.messages.messages--error' success_message_selector: '.messages.messages--status' warning_message_selector: '.messages.messages--warning' +ci: + extensions: + Behat\MinkExtension: + base_url: "http://localhost:80" diff --git a/bin/create-artifact-environment-pantheon b/bin/create-artifact-environment-pantheon index 25ebfa7..27e8faf 100755 --- a/bin/create-artifact-environment-pantheon +++ b/bin/create-artifact-environment-pantheon @@ -30,7 +30,7 @@ error_out() { pattern=".*" site="$TERMINUS_SITE" -source="${TERMINUS_SOURCE_ENVIRONMENT:-live}" +source="${TERMINUS_ENV:-live}" dryrun=0 while getopts "hb:i:s:n" opt; do case "$opt" in diff --git a/bin/refresh-local-pantheon b/bin/refresh-local-pantheon index 33099eb..cc11b22 100755 --- a/bin/refresh-local-pantheon +++ b/bin/refresh-local-pantheon @@ -12,7 +12,7 @@ Refresh your local environment from Pantheon. Options: -h: Show help -i: Set the Pantheon site that will be used (defaults to TERMINUS_SITE). - -s: Set the Pantheon environment that will be used (defaults to TERMINUS_SOURCE_ENVIRONMENT/live) + -s: Set the Pantheon environment that will be used (defaults to TERMINUS_ENV/live) -c: Set the cache directory to work from. -n: Dry run (does not create environment). @@ -29,7 +29,7 @@ error_out() { } site="$TERMINUS_SITE" -source="${TERMINUS_SOURCE_ENVIRONMENT:-live}" +source="${TERMINUS_ENV:-live}" cache="/tmp/site-import-cache" dryrun=0 while getopts "hi:s:c:n" opt; do @@ -43,7 +43,7 @@ while getopts "hi:s:c:n" opt; do done test -n "$site" || error_out "Site must be set using the -i flag or the TERMINUS_SITE environment variable" 1 -test -n "$source" || error_out "Source environment must be set using the -s flag or the TERMINUS_SOURCE_ENVIRONMENT environment variable" 1 +test -n "$source" || error_out "Source environment must be set using the -s flag or the TERMINUS_ENV environment variable" 1 mkdir -p "$cache" diff --git a/config/README.txt b/config/README.txt new file mode 100644 index 0000000..e74ef61 --- /dev/null +++ b/config/README.txt @@ -0,0 +1 @@ +This directory contains configuration to be imported into your Drupal site. To make this configuration active, visit admin/config/development/configuration/sync. For information about deploying configuration between servers, see https://www.drupal.org/documentation/administer/config diff --git a/docker-compose.yml b/docker-compose.yml index cf88c47..e22fada 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,7 +33,7 @@ services: links: - mysql - redis - env_file: [docker/drupal.env] + env_file: [.env/drupal.env] environment: APACHE_DOCROOT: /var/www/web MYSQL_HOST: mysql @@ -42,9 +42,9 @@ services: MYSQL_DATABASE: drupal CACHE_HOST: redis DOCKER_ENV: local - # SITE_NAME: # Set in docker/drupal.env - # TERMINUS_SITE: # Set in docker/drupal.env - # TERMINUS_SOURCE_ENVIRONMENT: # Set in docker/drupal.env + # SITE_NAME: # Set in .env/drupal.env + # TERMINUS_SITE: # Set in .env/drupal.env + # TERMINUS_ENV: # Set in .env/drupal.env TERMINUS_MACHINE_TOKEN: # Optionally set in .env. XDEBUG_CONFIG: # Optionally set in .env. XDEBUG_ENABLE: # Optionally sert in .env. diff --git a/docker/default.vcl b/docker/default.vcl deleted file mode 100644 index b15b723..0000000 --- a/docker/default.vcl +++ /dev/null @@ -1,128 +0,0 @@ -vcl 4.0; - -# This is a VCL configuration file for Varnish. - -backend default { - .host = "drupal"; - .port = "80"; -} - -# Access control list for PURGE/BAN requests. -acl purge { - "172.0.0.0/8"; -} - -sub vcl_recv { - # Only allow PURGE requests from IP addresses in the 'purge' ACL. - if (req.method == "PURGE") { - if (!client.ip ~ purge) { - return (synth(405, "Not allowed.")); - } - return (purge); - } - - # Only allow BAN requests from IP addresses in the 'purge' ACL. - if (req.method == "BAN") { - # Same ACL check as above: - if (!client.ip ~ purge) { - return (synth(403, "Not allowed.")); - } - - # Logic for the ban, using the Cache-Tags header. For more info - # see https://github.com/geerlingguy/drupal-vm/issues/397. - if (req.http.Cache-Tags) { - ban("obj.http.Cache-Tags ~ " + req.http.Cache-Tags); - } - else if (req.http.X-Url) { - ban("obj.http.X-Url ~ " + req.http.X-Url); - } - else { - return (synth(403, "Cache-Tags or X-Url header missing.")); - } - - # Throw a synthetic page so the request won't go to the backend. - return (synth(200, "Ban added.")); - } - - # Large static files are delivered directly to the end-user without - # waiting for Varnish to fully read the file first. - # Varnish 4 fully supports Streaming, so set do_stream in vcl_backend_response() - if (req.url ~ "^[^?]*\.(7z|avi|bz2|flac|flv|gz|mka|mkv|mov|mp3|mp4|mpeg|mpg|ogg|ogm|opus|rar|tar|tgz|tbz|txz|wav|webm|xz|zip)(\?.*)?$") { - unset req.http.Cookie; - return (hash); - } - - # Remove all cookies for static files - # A valid discussion could be held on this line: do you really need to cache static files that don't cause load? Only if you have memory left. - # Sure, there's disk I/O, but chances are your OS will already have these files in their buffers (thus memory). - # Before you blindly enable this, have a read here: https://ma.ttias.be/stop-caching-static-files/ - if (req.url ~ "^[^?]*\.(7z|avi|bmp|bz2|css|csv|doc|docx|eot|flac|flv|gif|gz|ico|jpeg|jpg|js|less|mka|mkv|mov|mp3|mp4|mpeg|mpg|odt|otf|ogg|ogm|opus|pdf|png|ppt|pptx|rar|rtf|svg|svgz|swf|tar|tbz|tgz|ttf|txt|txz|wav|webm|webp|woff|woff2|xls|xlsx|xml|xz|zip)(\?.*)?$") { - unset req.http.Cookie; - return (hash); - } - - # Only allow SESS, NO_CACHE, and MoodleSession cookies directly through. All others are stripped. - if (req.http.Cookie) { - set req.http.Cookie = ";" + req.http.Cookie; - set req.http.Cookie = regsuball(req.http.Cookie, "; +", ";"); - set req.http.Cookie = regsuball(req.http.Cookie, ";(SESS[a-z0-9]+|NO_CACHE|MoodleSession)=", "; \1="); - set req.http.Cookie = regsuball(req.http.Cookie, ";[^ ][^;]*", ""); - set req.http.Cookie = regsuball(req.http.Cookie, "^[; ]+|[; ]+$", ""); - - if (req.http.Cookie == "") { - # If there are no remaining cookies, remove the cookie header. If there - # aren't any cookie headers, Varnish's default behavior will be to cache - # the page. - unset req.http.Cookie; - } - else { - # If there is any cookies left (a session or NO_CACHE cookie), do not - # cache the page. Pass it on to Apache directly. - return (pass); - } - } -} - -# Code determining what to do when serving items from the Apache servers. -sub vcl_backend_response { - # Don't allow static files to set cookies. - if (bereq.url ~ "^[^?]*\.(7z|avi|bmp|bz2|css|csv|doc|docx|eot|flac|flv|gif|gz|ico|jpeg|jpg|js|less|mka|mkv|mov|mp3|mp4|mpeg|mpg|odt|otf|ogg|ogm|opus|pdf|png|ppt|pptx|rar|rtf|svg|svgz|swf|tar|tbz|tgz|ttf|txt|txz|wav|webm|webp|woff|woff2|xls|xlsx|xml|xz|zip)(\?.*)?$") { - unset beresp.http.set-cookie; - } - - # Large static files are delivered directly to the end-user without - # waiting for Varnish to fully read the file first. - # Varnish 4 fully supports Streaming, so use streaming here to avoid locking. - if (bereq.url ~ "^[^?]*\.(7z|avi|bz2|flac|flv|gz|mka|mkv|mov|mp3|mp4|mpeg|mpg|ogg|ogm|opus|rar|tar|tgz|tbz|txz|wav|webm|xz|zip|csv)(\?.*)?$") { - unset beresp.http.set-cookie; - set beresp.do_stream = true; # Check memory usage it'll grow in fetch_chunksize blocks (128k by default) if the backend doesn't send a Content-Length header, so only enable it for big objects - set beresp.do_gzip = false; # Don't try to compress it for storage - } - - # Set ban-lurker friendly custom headers - set beresp.http.X-Url = bereq.url; - set beresp.http.X-Host = bereq.http.host; - - # Allow items to be stale if needed. - set beresp.grace = 1h; -} - -sub vcl_deliver { - # These headers are for internal use (or debugging) only - unset resp.http.X-Url; - unset resp.http.X-Host; - unset resp.http.X-Upstream; - unset resp.http.Cache-Tags; - unset resp.http.X-Drupal-Cache; - unset resp.http.X-Drupal-Dynamic-Cache; - - if (obj.hits > 0) { - set resp.http.X-Edge-Cache = "HIT"; - } else { - set resp.http.X-Edge-Cache = "MISS"; - } -} - -sub vcl_purge { - return (synth(200, "Purged")); -} diff --git a/docker/mysql-extra.cnf b/docker/mysql-extra.cnf deleted file mode 100644 index 2801299..0000000 --- a/docker/mysql-extra.cnf +++ /dev/null @@ -1,2 +0,0 @@ -[mysqld] -max_allowed_packet=16M diff --git a/docs/recipes/adding-modules.md b/docs/recipes/adding-modules.md index cc2c8cc..f0ce7de 100644 --- a/docs/recipes/adding-modules.md +++ b/docs/recipes/adding-modules.md @@ -2,23 +2,22 @@ Adding Modules/Themes --------------------- Use composer to bring in modules and themes. For example, if you want to add the [metatag](https://www.drupal.org/project/metatag) module, you would use the following workflow: +All commands can be run from your host machine. + 1. Add the module using composer: ```bash - # from inside drupal container: - composer require drupal/metatag + lando composer require drupal/metatag ``` 2. Enable the module: ```bash - # from inside drupal container: - drush en metatag + lando drush en metatag ``` 3. Export the configuration that includes the metatag module: ```bash - drush config-export -y + lando drush config-export -y ``` 4. Review and commit configuration changes: ```bash - # from your host machine: git status config/ # review changes, make sure there is nothing unexpected # finalize the changes by committing them. git add config/ diff --git a/docs/scaffold.md b/docs/scaffold.md index b4ecec7..e228843 100644 --- a/docs/scaffold.md +++ b/docs/scaffold.md @@ -26,7 +26,7 @@ Customizing your Project As soon as you're up and running, you will want to remove the references to the "scaffold" nature of this project and make it your own. - [ ] Set the name of your project under the `name` key in `composer.json` and `package.json`. You don't ever need to publish the project using Composer or NPM, but it will help new developers get oriented. - [ ] Rename the `scaffold` theme to something that fits your project. -- [ ] Open [`docker/drupal.env`](/docker/drupal.env) and set the environment variables there. +- [ ] Open [`.env/drupal.env`](/.env/drupal.env) and set the environment variables there. - [ ] Open [`web/private/scripts/deploy-steps.php`](/web/private/scripts/deploy-steps.php) and choose the deployment steps you want to use. - [ ] Copy [`.env.example`](/.env.example) to `.env` and optionally set the variables in this file. This file should not be committed. - [ ] Customize README.md by renaming, and removing everything above the horizontal rule. @@ -44,7 +44,7 @@ Upgrading an older project is a very manual process - once you start a project, - [ ] Run `composer upstream-files:update` to pull down the latest versions of all scaffold files and quasi-core files. REVIEW CAREFULLY BEFORE COMMITTING - you will definitely need to revert or manually merge some of the files. - [ ] Run `yarn install` to install NPM dependencies and create a `yarn.lock` file. - [ ] Cleanup any leftover files: `rm -rf default.behat.local.yml ci package-lock.json backstop phantomas ci circle.yml .travis.yml docker-compose.debug.yml web/drush` -- [ ] Open [`docker/drupal.env`](/docker/drupal.env) and set the environment variables there. +- [ ] Open [`.env/drupal.env`](/.env/drupal.env) and set the environment variables there. - [ ] Copy [`.env.example`](/.env.example) to `.env` and optionally set the variables in this file. This file should not be committed. - [ ] In CircleCI, add the `TERMINUS_MACHINE_TOKEN` variable (previously known as `PMACHINE`). - [ ] Push a new `p-` branch to GitHub to trigger a circle build, and create a new PR to review your changes. diff --git a/docs/tools/blackfire.md b/docs/tools/blackfire.md index d5d421a..7f1fc1c 100644 --- a/docs/tools/blackfire.md +++ b/docs/tools/blackfire.md @@ -4,16 +4,19 @@ Blackfire Configuration ------------- -Blackfire is already set up, but profiling requires the entry of your client and server tokens in the `.env` file. See https://blackfire.io to sign up (free) and get those tokens. +Blackfire is already set up, but profiling requires the entry of your client and server tokens in the `.lando/env/private.env` file. See https://blackfire.io to sign up (free) and get those tokens from https://blackfire.io/my/settings/credentials. Running ------- -* From the Drupal container: `blackfire curl http://127.0.0.1/my/page` will run a profile of `/my/page`. -* From the Drupal container: `blackfire run php myscript.php` will run a profile of `myscript.php`. +* From the host: `lando blackfire curl -k https://drupal-scaffold.lndo.site/my/page` will run a profile of `/my/page`. +* From the host: `lando blackfire run php myscript.php` will run a profile of `myscript.php`. Uninstalling ------------ -1. Remove your Blackfire tokens from the `.env` file. -2. Remove the blackfire container from `docker-compose.yml` -3. Remove the BLACKFIRE_* environment variables from `docker-compose.yml`. +1. Remove your Blackfire tokens from the `.lando/env/private.env` file. +2. Remove the blackfire config from `.lando.yml`: + - `build_as_root` in `appserver` service override: remove `.lando/init/blackfire.sh` step + - `config` in `appserver` service override: remove `conf: .lando/init/php.ini` + - TODO: Any other steps in `.lando.yml` that need to be removed? 4. Commit the changes. +5. Rebuild appserver lando service `lando rebuild -s appserver` diff --git a/docs/tools/composer.md b/docs/tools/composer.md index b34ed56..8581b70 100644 --- a/docs/tools/composer.md +++ b/docs/tools/composer.md @@ -1,7 +1,9 @@ Composer ======== -We recommend using [Composer](https://getcomposer.org) to manage all third party PHP code dependencies, include contributed Drupal modules and themes. Composer comes pre-installed in the `drupal` container. +We recommend using [Composer](https://getcomposer.org) to manage all third party PHP code dependencies, include contributed Drupal modules and themes. Composer comes pre-installed with Lando. + +All commands below can be un as `lando composer ...` from the host machine as well. Installing a new Module/Theme/Library ------------------------------------- diff --git a/docs/tools/docker.md b/docs/tools/docker.md deleted file mode 100644 index 9d6883d..0000000 --- a/docs/tools/docker.md +++ /dev/null @@ -1,51 +0,0 @@ -Docker -====== - -[Docker](https://docs.docker.com/) is an open platform for developers and sysadmins to build, ship, and run distributed applications. In this project, it is software that lives on your local machine that allows you to run preconfigured development environments without extensive configuration. Specifically, this project uses [Docker Compose](https://docs.docker.com/compose/) to define and run the local development environment. - -Note: The Docker configuration that comes with this project is not suitable for production hosting. It is intended for use in local or development environments only. - -Installing ----------- -You must have `docker` and `docker-compose` installed on your local machine before using the Docker environments. - -[Mac](https://docs.docker.com/docker-for-mac/install/) | [Windows](https://docs.docker.com/docker-for-windows/install/) - -Configuration -------------- -All Docker configuration for this project lives in the [`docker-compose.yml`](/docker-compose.yml) file in the repository root. You may customize this file if you would like, or you may use the following files to customize your environment further: - -* [`docker/drupal.env`](/docker/drupal.env) - This file contains environment variables that are injected into the `drupal` container. It should be committed to the repository, so do not put anything sensitive in here. -* `.env` - This file can contain environment variables that get referenced in `docker-compose.yml`. See [`.env.example`](/.env.example) for documentation on variables may be used. - -For port configuration, changing the "exposed" port does not change the port inside of the container. Eg: If you change the `MANNEQUIN_PORT` variable to 8007, you should still run Mannequin inside of the container on 8081, but you will access it from your browser at `localhost:8007`. - -Running -------- -Use the `docker-compose` command on your host to interact with Docker. - -* Start all containers: `docker-compose up -d` -* List running containers: `docker-compose ps` -* Stop all containers: `docker-compose stop` -* Download updates to all containers: `docker-compose pull` -* Output the logs of the `drupal` container: `docker-compose logs drupal` -* Remove all containers to reset your environment: `docker-compose down` - -Note that MySQL data will not be removed, even when you remove the `mysql` container. To fully delete this data, use `docker-compose down -v`. - -Accessing the Containers ------------------------- -When the containers are running, they are accessible on the following ports: - -* **8080**: Direct connection to Drupal running on Apache. -* **33306**: Direct connection to MySQL. Useful for connecting to the database from the host machine. A direct mysql connection can be made from the outside via: `mysql -h 127.0.0.1 --port 33306 -u drupal -pdrupal drupal` - -Optional containers (must be enabled before you can use them): -* **8085**: Varnish, connected to Drupal. If you want to use Varnish, uncomment it in `docker-compose.yml` -* **8983**: Solr direct connection. Useful for debugging via Apache Solr web interface. - -Important: Should you choose to run this setup in production, you should always remove the debug ports (noted in `docker-compose.yml`) for security. - -Troubleshooting ---------------- -* If you see an error message bringing up the containers that has something like "port is already allocated", it means that another application is already using one of the ports. You can set alternate ports in `.env` (see [Confguration](#Configuration)). diff --git a/docs/tools/drush.md b/docs/tools/drush.md index 3ace1e6..e1514c2 100644 --- a/docs/tools/drush.md +++ b/docs/tools/drush.md @@ -9,12 +9,7 @@ Drush configuration and extra commands can be added in the `drush/` directory in Running ------- -Inside of the `drupal` container, Drush is already installed. You can run it just by typing `drush`. Examples: -* `drush uli` - Generate a one time login link. -* `drush en page_cache` - Enable the page cache module. - -Uninstalling ------------- -1. Run `composer remove --dev drush/drush`. -2. Run `git rm drush/` -3. Commit changes. +Drush comes preinstalled in the `appserver` service of the Lando development environment. +You can run it from the host machine by typing `lando drush`. Examples: +* `lando drush uli` - Generate a one time login link. +* `lando drush en page_cache` - Enable the page cache module. diff --git a/docs/tools/gulp.md b/docs/tools/gulp.md index dccac8c..2577b10 100644 --- a/docs/tools/gulp.md +++ b/docs/tools/gulp.md @@ -3,18 +3,21 @@ Gulp This project uses [Gulp](https://gulpjs.com/) to build front-end assets. See [Gulp Drupal Tasks](https://github.com/LastCallMedia/gulp-drupal-tasks) for more information. +Gulp is installed globally on the `node` service in the Lando local development environment. + Configuration ------------- Gulp configuration lives in `gulpconfig.js` in the repository root. You may also update `gulpfile.js` if you wish to add additional tasks. Running ------- -* `composer build` to run all Gulp build tasks. -* `node_modules/.bin/gulp` for access to more fine-grained tasks. +* `lando gulp build` to run a one time asset compilation +* `lando gulp watch` to continually watch configured files and compile them on the fly Uninstalling ------------ -1. Run `yarn remove gulp gulp-help lastcall-gulp-drupal-tasks` to remove the dependencies. -2. Edit `composer.json` to remove the `build` and `build:watch` scripts. +1. Remove `gulp-cli` from `globals` section of `node` service declaration in `.lando.yml` +2. Remove `gulp` entry from `tooling` section of `.lando.yml` +1. Run `lando yarn remove gulp gulp-help lastcall-gulp-drupal-tasks` to remove the dependencies. 3. Delete `gulpconfig.js` and `gulpfile.js` 4. Commit changes. diff --git a/docs/tools/lando.md b/docs/tools/lando.md new file mode 100644 index 0000000..7142358 --- /dev/null +++ b/docs/tools/lando.md @@ -0,0 +1,42 @@ +Docker +====== + +[Lando](https://docs.lando.dev/) is an local development platform for developers. It is software that lives on your local machine that allows you to run preconfigured development environments without extensive configuration. + +Installing +---------- +You must have `lando` installed on your local machine before using the Lando environments. + +Installers for Windows, Mac, and various Linux distributions can be found on the [releases page](https://github.com/lando/lando/releases). Generally the newest release available is preferred. + +Configuration +------------- +All Docker configuration for this project lives in the [`.lando.yml`](/.lando.yml) file in the repository root. You may customize this file to suit the needs of the project. + +Running +------- +Use the `lando` command on your host to interact with Lando. + +* Start all containers: `docker-compose start` +* View lando service info: `lando info` +* Stop all containers: `lando stop` +* Rebuild all services: `lando rebuild` +* Output the logs of the `lando` services: `lando logs`, `lando logs -s appserver` +* Remove all containers to reset your environment: `lando destroy` + +Accessing the Containers +------------------------ +When the containers are running, they are accessible on the following ports: + +* **8080**: Direct connection to Drupal running on Apache. +* **33306**: Direct connection to MySQL. Useful for connecting to the database from the host machine. A direct mysql connection can be made from the outside via: `mysql -h 127.0.0.1 --port 33306 -u drupal -pdrupal drupal` + +Optional containers (must be enabled before you can use them): +* **8085**: Varnish, connected to Drupal. If you want to use Varnish, uncomment it in `docker-compose.yml` +* **8983**: Solr direct connection. Useful for debugging via Apache Solr web interface. + +Important: Should you choose to run this setup in production, you should always remove the debug ports (noted in `docker-compose.yml`) for security. + +Troubleshooting +--------------- +* If you see an error message bringing up the containers that has something like "port is already allocated", it means that another application is already using one of the ports. You can set alternate ports in `.env` (see [Confguration](#Configuration)). diff --git a/docs/tools/mannequin.md b/docs/tools/mannequin.md index a11c040..e4b3c2d 100644 --- a/docs/tools/mannequin.md +++ b/docs/tools/mannequin.md @@ -6,8 +6,31 @@ Configuration ------------- Mannequin is configured in `.mannequin.php`. Mannequin metadata is added to theme templates as YAML comment blocks. +Accessing +--------- +Mannequin is configured as a mannequin service, and can be accessed at https://mannequin.lndo.site + +This is using mannequin in "server" mode, so it watches for changes and will automatically update as templates css changes + Uninstalling ------------ 1. Run `composer remove --dev lastcall/mannequin-drupal`. -2. Run `git rm .mannequin.php`. -3. Commit changes. +1. Run `git rm .mannequin.php`. +1. Remove the following sections from `.lando.yml` + * + ``` + proxy: + mannequin: + - mannequin.lndo.site + ``` + * + ``` + services: + mannequin: + type: compose + services: + image: devwithlando/php:7.3-apache + command: docker-php-entrypoint /app/vendor/bin/mannequin start -c /app/.mannequin.php *:80 + ``` + +1. Commit changes. diff --git a/docs/tools/npm.md b/docs/tools/npm.md index 78ecdba..1ded328 100644 --- a/docs/tools/npm.md +++ b/docs/tools/npm.md @@ -1,7 +1,7 @@ NPM/Yarn -------- -Node Package Manager(npm) is a package management tool for NodeJS packages. Yarn is a newer, faster tool that does the same thing. NPM and Yarn are both installed in the `drupal` container. +Node Package Manager(npm) is a package management tool for NodeJS packages. Yarn is a newer, faster tool that does the same thing. NPM and Yarn are both installed in the `node` service of the Lando local development environment. Configuration ------------- @@ -11,7 +11,14 @@ Running ------- Use `yarn` rather than `npm` - these two commands are equivalent, but `yarn` is faster, and the CircleCI build relies on a `yarn.lock` file that gets generated when you use `yarn`. -* Install all dependencies: `yarn install` -* Update dependencies to the latest versions: `yarn upgrade` -* List outdated dependencies: `yarn outdated` -* Add a new dependency: `yarn add mypackage`. This will add the package to `package.json` and install it right away. +* Install all dependencies: `lando yarn install` +* Update dependencies to the latest versions: `lando yarn upgrade` +* List outdated dependencies: `lando yarn outdated` +* Add a new dependency: `lando yarn add mypackage`. This will add the package to `package.json` and install it right away. + +Enabling NPM +------------ +By default, `npm` is disabled in the local Lando development. This is done because it can create confusion if some people use `npm` while others use `yarn`. Yarn will complain if it sees a `package-lock.json` file as well. + +To enable the use of `npm`, remove npm tooling override in the `tooling` section of `.lando.yml` in the project root. +You are also able to use `npm` by `ssh`ing into the `node` service (`lando ssh -s node`) diff --git a/docs/tools/varnish.md b/docs/tools/varnish.md deleted file mode 100644 index 91a9765..0000000 --- a/docs/tools/varnish.md +++ /dev/null @@ -1,16 +0,0 @@ -Varnish -------- - -[Varnish](https://varnish-cache.org/) is an HTTTP reverse proxy cache that stores cached pages "at the edge". Many hosts (Pantheon, Acquia) use it as part of their platform. Varnish sits in front of Apache and PHP, so when you visit the site, the first server you hit is the Varnish server, which passes requests back to Apache if it is not able to serve a page from the cache. - -Configuration -------------- -Varnish configuration (VCL) is stored in [default.vcl](/docker/default.vcl). - -Running -------- -To use Varnish: - -1. Uncomment the `varnish` container in [`docker-compose.yml`](/docker-compose.yml). -2. Run `docker-compose up -d varnish` to bring the Varnish container up. -3. Visit the site on port 8085 instead of 8080. diff --git a/docs/tools/wdio.md b/docs/tools/wdio.md deleted file mode 100644 index 89f6690..0000000 --- a/docs/tools/wdio.md +++ /dev/null @@ -1,30 +0,0 @@ -Webdriver IO -============ - -Webdriver IO is an end-to-end testing tool that uses Selenium. It can perform functional tests as well as Visual Regression tests. - -Tests using Webdriver IO will be slower than any other type of test, so use them sparingly. - -Configuration -------------- -Configuration lives in `wdio.conf.js`. Test files live in the `wd/tests` directory. - - -### Mocha Tests -Standard [Mocha](https://mochajs.org/) test cases can be run by writing the test cases in the `specs` directory. - -### Visual Regression Testing -Visual regression tests can be run by writing test cases in the `wd/specs` directory. VRT runs using [wdio-visual-regression-service](https://www.npmjs.com/package/wdio-visual-regression-service). In the provided sample configuration, screenshots are captured to the `wd/screenshots/taken` directory, and compared with reference samples in the `wd/screenshots/reference` directory. If a difference is found, a comparison image will be generated to highlight the difference, and placed into the `wd/screenshots/diff` directory. - -Running -------- -* `node_modules/.bin/wdio` Run all tests. -* `node_modules/.bin/wdio --spec wd/tests/vrt.js` Run one test. - -Uninstalling ------------- -1. Run `yarn remove lastcall-scaffold-webdriver` to remove the Node modules required for the webdriver. -2. Edit `composer.json` to remove the `@test:wdio` key from the `test` script. -3. Remove the "Run WDIO" step from `.circleci/config.yml`. -4. Optionally, remove the `wd/` directory entirely. -5. Commit changes. diff --git a/docs/tools/xdebug.md b/docs/tools/xdebug.md index 4182aca..53b6053 100644 --- a/docs/tools/xdebug.md +++ b/docs/tools/xdebug.md @@ -1,41 +1,20 @@ -XDebug +Xdebug ====== -[XDebug](https://xdebug.org) is a remote debugging tool that allows you to pause execution of your code and view variables in real time. XDebug is available for debugging in the `drupal` container. +[Xdebug](https://xdebug.org) is a remote debugging tool that allows you to pause execution of your code and view variables in real time. Xdebug is available for debugging in the `appserver` service within the Lando local development environment. + +While Xdebug is a great tool for debugging, it does add additional performance overhead. Because of this, Xdebug is _disabled_ by default in local environments. It's easy to enable though. Configuration ------------- -Create or update the `.env` file at the repository root to enable XDebug: - -```bash -XDEBUG_ENABLE=1 -``` - -Then, run `docker-compose up -d drupal` to recreate the Drupal container with this setting. This will configure XDebug with the following defaults: - -``` -xdebug.remote_host=host.docker.internal -xdebug.idekey=PHPSTORM -xdebug.remote_enable=On -xdebug.remote_autostart=On -``` - -This configuration is sufficient to tell XDebug to always be on, and to connect back to your local computer to initiate a debugging session. See the "[Usage](#Usage)" section below for next steps. - -You can test if XDebug is properly enabled by running: -```shell script -docker-compose exec drupal php -i | grep xdebug -``` -If XDebug is enabled and configured, you should see several XDebug configuration parameters listed. +Change the value from `xdebug: false` to `xdebug: true` in `.lando.yml` and run `lando rebuild` to enable Xdebug. Usage ----- - -1. Using PHPStorm, add a new "PHP Remote Debug" configuration. -2. Set breakpoints in your code. -3. Visit the site in your browser. -4. Step through code in your IDE. +See the Lando documentation to configure Xdebug in your IDE. +* [PHPStorm](https://docs.lando.dev/guides/lando-phpstorm.html) (bonus [youtube video](https://www.youtube.com/watch?v=sHNJxx0L9r0)) +* [VSCode](https://docs.lando.dev/guides/lando-with-vscode.html) Uninstalling ------------ -Xdebug is bundled with the [PHP Docker](https://github.com/LastCallMedia/PHP-Docker) container used for this project and can't be uninstalled. In the absence of the XDEBUG_ENABLE environment variable, the extension will be disabled though. +Change the value from `xdebug: true` to `xdebug: false` in `.lando.yml` and run `lando rebuild` to disable Xdebug. diff --git a/src/Resources/manifests/scaffold.json b/src/Resources/manifests/scaffold.json index e4058c9..9d0a205 100644 --- a/src/Resources/manifests/scaffold.json +++ b/src/Resources/manifests/scaffold.json @@ -11,7 +11,7 @@ "../../../behat.yml": "behat.yml", "../../../src/ComposerHandler.php": "src/ComposerHandler.php", "../../../docker/default.vcl": "docker/default.vcl", - "../../../docker/drupal.env": "docker/drupal.env", + "../../../.env/drupal.env": ".env/drupal.env", "../../../docker/mysql-extra.cnf": "docker/mysql-extra.cnf", "../../../docker-compose.yml": "docker-compose.yml", "../../../drush/drushrc.php": "drush/drushrc.php", diff --git a/web/sites/default/settings.docker.php b/web/sites/default/settings.docker.php index 673e7d8..a7ceca1 100644 --- a/web/sites/default/settings.docker.php +++ b/web/sites/default/settings.docker.php @@ -39,4 +39,3 @@ // $settings['cache']['bins']['config'] = 'cache.backend.chainedfast'; // $settings['cache']['bins']['discovery'] = 'cache.backend.chainedfast'; } - diff --git a/web/sites/default/settings.lando.php b/web/sites/default/settings.lando.php new file mode 100644 index 0000000..122abce --- /dev/null +++ b/web/sites/default/settings.lando.php @@ -0,0 +1,12 @@ + 'drupal8', + 'username' => 'drupal8', + 'password' => 'drupal8', + 'prefix' => '', + 'host' => 'database', + 'port' => '3306', + 'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql', + 'driver' => 'mysql', +); diff --git a/web/sites/default/settings.php b/web/sites/default/settings.php index e937208..6cc3d2e 100644 --- a/web/sites/default/settings.php +++ b/web/sites/default/settings.php @@ -26,6 +26,10 @@ require __DIR__ . '/settings.docker.php'; } +if((isset($_ENV['LANDO'])) && ($_ENV['LANDO'] === 'ON') && (file_exists(__DIR__ . '/settings.lando.php'))) { + require __DIR__ . '/settings.lando.php'; +} + // Include an optional local settings override. Assumes Pantheon is production // host, these checks can be changed to work with other hosting providers as // well.